当前位置:网站首页>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
边栏推荐
- 2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
- Gaode map search, drag and drop query address
- .105Location
- C language input and output (printf and scanf functions, putchar and getchar functions)
- 587. Install fence / Sword finger offer II 014 Anagrams in strings
- Leak detection and vacancy filling (6)
- Chrome浏览器的跨域设置----包含新老版本两种设置
- Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)
- EasymodbusTCP之clientexample解析
- Transfer learning of five categories of pictures based on VGg
猜你喜欢
随机推荐
列錶的使用-增删改查
Amount input box, used for recharge and withdrawal
Cloud native Virtualization: building edge computing instances based on kubevirt
土地覆盖/利用数据产品下载
cv_ Solution of mismatch between bridge and opencv
C# 网络相关操作
极致体验,揭晓抖音背后的音视频技术
Dry goods | how to extract thumbnails quickly?
Chrome浏览器的跨域设置----包含新老版本两种设置
ES6 face test questions (reference documents)
C1 notes [task training chapter I]
油猴网站地址
2022江西光伏展,中國分布式光伏展會,南昌太陽能利用展
1217_ Generating target files using scons
The method of changing a value in the array and a value in the object of wechat applet
Leak detection and vacancy filling (6)
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
Classification of cifar100 data set based on convolutional neural network
Implementation of object detection case based on SSD
2022 judgment questions and answers for operation of refrigeration and air conditioning equipment