当前位置:网站首页>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
边栏推荐
- 2022.07.02
- Charles+drony的APP抓包
- Review of network attack and defense
- Interview vipshop internship testing post, Tiktok internship testing post [true submission]
- SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
- 炒股如何开户?请问一下手机开户股票开户安全吗?
- 99% of people don't know that privatized deployment is also a permanently free instant messaging software!
- A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)
- 【MIME笔记】
- The top of slashdata developer tool is up to you!!!
猜你喜欢
Learn open62541 -- [67] add custom enum and display name
The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
Redis cluster and expansion
Wechat web debugging 8.0.19 replace the X5 kernel with xweb, so the X5 debugging method can no longer be used. Now there is a solution
Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
2022.07.05
Basic concepts and properties of binary tree
Three forms of multimedia technology commonly used in enterprise exhibition hall design
Zhong Xuegao wants to remain innocent in the world
随机推荐
Redis publishing and subscription
Is AI more fair than people in the distribution of wealth? Research on multiplayer game from deepmind
【HDU】5248-序列变换(贪心+二分)「建议收藏」
How to estimate the value of "not selling pens" Chenguang?
Charles+Postern的APP抓包
抢占周杰伦
Mathematical analysis_ Notes_ Chapter 11: Fourier series
數據驗證框架 Apache BVal 再使用
Initial experience of cache and ehcache "suggestions collection"
完整的电商系统
GSAP animation library
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
Cloud security daily 220707: Cisco Expressway series and telepresence video communication server have found remote attack vulnerabilities and need to be upgraded as soon as possible
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
"Decryption" Huawei machine vision Corps: Huawei is moving up and the industry is moving forward
6. About JWT
How to choose the appropriate automated testing tools?
Big Ben (Lua)
反爬虫的重点:识别爬虫
炒股如何开户?请问一下手机开户股票开户安全吗?