当前位置:网站首页>Array rotation
Array rotation
2022-04-23 17:58:00 【Feng Ye 520】
import numpy as np
l = np.arange(1, 17, dtype='int16')
l.shape = (4, 4)
print(l)
print()
f1 = lambda x:np.array(list(zip(*l)))
l1 = f1(l)
print(l1)
print()
# Clockwise rotation 90 degree
f2 = lambda x:np.array(list(zip(*l[::-1])))
l2 = f2(l)
print(l2)
print()
# Counter clockwise rotation 90 degree
f3 = lambda x:np.array(list(zip(*map(lambda x:x[::-1], l))))
l3 = f3(l)
print(l3)
版权声明
本文为[Feng Ye 520]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230546152320.html
边栏推荐
- Yolov4 pruning [with code]
- MySQL 中的字符串函数
- 2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
- MySQL advanced index [classification, performance analysis, use, design principles]
- Error in created hook: "referenceerror:" promise "undefined“
- Eigen learning summary
- C#字节数组(byte[])和字符串相互转换
- Detailed deployment of flask project
- 列錶的使用-增删改查
- Operators in C language
猜你喜欢
Implementation of image recognition code based on VGg convolutional neural network
String function in MySQL
MySQL_01_简单数据检索
Auto.js 自定义对话框
Error in created hook: "referenceerror:" promise "undefined“
2022制冷与空调设备运行操作判断题及答案
Go对文件操作
Halo open source project learning (II): entity classes and data tables
102. Sequence traversal of binary tree
C network related operations
随机推荐
ROS package NMEA_ navsat_ Driver reads GPS and Beidou Positioning Information Notes
Leak detection and vacancy filling (VII)
SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
Clion installation tutorial
Compilation principle first set follow set select set prediction analysis table to judge whether the symbol string conforms to the grammar definition (with source code!!!)
2022年广东省安全员A证第三批(主要负责人)特种作业证考试题库及在线模拟考试
2022 judgment questions and answers for operation of refrigeration and air conditioning equipment
C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
ES6 face test questions (reference documents)
C byte array (byte []) and string are converted to each other
Gaode map search, drag and drop query address
Amount input box, used for recharge and withdrawal
MySQL_ 01_ Simple data retrieval
How to read literature
_ FindText error
C1 notes [task training part 2]
Client example analysis of easymodbustcp
MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
MySQL进阶之索引【分类,性能分析,使用,设计原则】
SystemVerilog (VI) - variable