当前位置:网站首页>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
边栏推荐
- 440. The k-th small number of dictionary order (difficult) - dictionary tree - number node - byte skipping high-frequency question
- k8s之实现redis一主多从动态扩缩容
- QTableWidget使用讲解
- JS interview question: FN call. call. call. Call (FN2) parsing
- Remember using Ali Font Icon Library for the first time
- Error in created hook: "referenceerror:" promise "undefined“
- SystemVerilog(六)-变量
- Applet learning notes (I)
- Client example analysis of easymodbustcp
- 开源按键组件Multi_Button的使用,含测试工程
猜你喜欢
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!!!)
C1 notes [task training chapter I]
Click Cancel to return to the previous page and modify the parameter value of the previous page, let pages = getcurrentpages() let prevpage = pages [pages. Length - 2] / / the data of the previous pag
2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
SQL optimization for advanced learning of MySQL [insert, primary key, sort, group, page, count]
SystemVerilog (VI) - variable
The ultimate experience, the audio and video technology behind the tiktok
1217_ Generating target files using scons
Data stream encryption and decryption of C
Laser slam theory and practice of dark blue College Chapter 3 laser radar distortion removal exercise
随机推荐
极致体验,揭晓抖音背后的音视频技术
587. 安装栅栏 / 剑指 Offer II 014. 字符串中的变位词
Oil monkey website address
JS parsing and execution process
2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
Arithmetic expression
Leak detection and vacancy filling (6)
Chrome浏览器的跨域设置----包含新老版本两种设置
.104History
2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
_ FindText error
Write a regular
C byte array (byte []) and string are converted to each other
Summary of common server error codes
C# 网络相关操作
20222 return to the workplace
2022制冷与空调设备运行操作判断题及答案
String function in MySQL
Uniapp custom search box adaptation applet alignment capsule
JS high frequency interview questions