当前位置:网站首页>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
边栏推荐
- An example of linear regression based on tensorflow
- C language input and output (printf and scanf functions, putchar and getchar functions)
- JS interview question: FN call. call. call. Call (FN2) parsing
- C language loop structure program
- 2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
- Yolov4 pruning [with code]
- Examination question bank and online simulation examination of the third batch (main person in charge) of special operation certificate of safety officer a certificate in Guangdong Province in 2022
- How to read literature
- C#的随机数生成
- .105Location
猜你喜欢
MySQL_ 01_ Simple data retrieval
Implementation of object detection case based on SSD
2022年上海市安全员C证操作证考试题库及模拟考试
k8s之实现redis一主多从动态扩缩容
Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)
Error in created hook: "referenceerror:" promise "undefined“
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!!!)
Random number generation of C #
Kubernetes service discovery monitoring endpoints
Leak detection and vacancy filling (6)
随机推荐
Summary of floating point double precision, single precision and half precision knowledge
一些问题一些问题一些问题一些问题
Auto. JS custom dialog box
I/O多路复用及其相关详解
C1 notes [task training chapter I]
Operation of 2022 mobile crane driver national question bank simulation examination platform
Implementation of image recognition code based on VGg convolutional neural network
2022江西储能技术展会,中国电池展,动力电池展,燃料电池展
干货 | 快速抽取缩略图是怎么练成的?
MySQL 中的字符串函数
Operators in C language
102. Sequence traversal of binary tree
2022江西光伏展,中国分布式光伏展会,南昌太阳能利用展
Client example analysis of easymodbustcp
Classes and objects
Halo open source project learning (II): entity classes and data tables
1217_ Generating target files using scons
Implementation of k8s redis one master multi slave dynamic capacity expansion
Go file operation
Comparison between xtask and kotlin coroutine