当前位置:网站首页>Numpy——2. Shape of array
Numpy——2. Shape of array
2022-07-07 19:14:00 【Hair will grow again without it】
The shape of the array
View the shape of the array
a.shape()
You can judge how many dimensions the array is by the number of returned values
Modify the shape of the array
a.reshape(x, y)Return value but not modified a Arraya.flatten()Turn the array directly into one dimension>
The calculation of array
Calculation of arrays and numbers
Broadcast mechanism
When calculating an array and a number , Apply this number to each element of the array , In fact, this number is expanded into the dimension of the sum array , Row number , An array with the same number of columns , Then do the operation on the corresponding element
Arrays and the calculation of arrays
identical shape Array of The calculation of , Directly add, subtract, multiply and divide the corresponding elements
Different shape Array of The calculation of , If it's two-dimensional , Rows and columns must have the same dimension , The other dimension is 1. If it is 3 One dimension minus one two dimension , Also look at rows and columns
It is also a broadcasting mechanism , It will expand the small one dimension of the row or column to the large one
example A two-dimensional
example The three dimensional
边栏推荐
- Save the memory of the model! Meta & UC Berkeley proposed memvit. The modeling time support is 30 times longer than the existing model, and the calculation amount is only increased by 4.5%
- 手把手教姐姐写消息队列
- Redis的发布与订阅
- 3. About cookies
- Command mode - unity
- Nat address translation
- 2022年推荐免费在线接收短信平台(国内、国外)
- Review of network attack and defense
- Redis集群与扩展
- [Tawang methodology] Tawang 3W consumption strategy - U & a research method
猜你喜欢
随机推荐
抢占周杰伦
How much does it cost to develop a small program mall?
Recommend free online SMS receiving platform in 2022 (domestic and foreign)
线程池中的线程工厂
Is AI more fair than people in the distribution of wealth? Research on multiplayer game from deepmind
PV静态创建和动态创建
Desci: is decentralized science the new trend of Web3.0?
Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
如何选择合适的自动化测试工具?
Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers
unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
Basic concepts and properties of binary tree
[sword finger offer] 59 - I. maximum value of sliding window
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
How many times is PTA 1101 B than a
企业MES制造执行系统的分类与应用
SD_ DATA_ SEND_ SHIFT_ REGISTER
反爬虫的重点:识别爬虫
A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)
In the first half of 2022, I found 10 books that have been passed around by my circle of friends

>














![学习open62541 --- [67] 添加自定义Enum并显示名字](/img/98/e5e25af90b3f98c2be11d7d21e5ea6.png)