当前位置:网站首页>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
边栏推荐
- 我感觉被骗了,微信内测 “大小号” 功能,同一手机号可注册两个微信
- Interview vipshop internship testing post, Tiktok internship testing post [true submission]
- Complete e-commerce system
- 手把手教姐姐写消息队列
- 6.关于jwt
- PV静态创建和动态创建
- POJ 1182: food chain (parallel search) [easy to understand]
- UVALive – 4621 Cav 贪心 + 分析「建议收藏」
- Learn open62541 -- [67] add custom enum and display name
- 微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
猜你喜欢

Antisamy: a solution against XSS attack tutorial
![[Tawang methodology] Tawang 3W consumption strategy - U & a research method](/img/63/a8c08ac6ec7d654159e5fc8b4423e4.png)
[Tawang methodology] Tawang 3W consumption strategy - U & a research method

Static routing configuration

In 2021, the national average salary was released. Have you reached the standard?

RISCV64

Policy mode - unity

Nat address translation

微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹

Review of network attack and defense

Complete e-commerce system
随机推荐
POJ 1182 :食物链(并查集)[通俗易懂]
Reinforcement learning - learning notes 8 | Q-learning
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
SlashData开发者工具榜首等你而定!!!
高温火烧浑不怕,钟薛高想留清白在人间
Reuse of data validation framework Apache bval
Redis集群与扩展
數據驗證框架 Apache BVal 再使用
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
DeSci:去中心化科学是Web3.0的新趋势?
鸿蒙智能家居【1.0】
Realize payment function in applet
2022年推荐免费在线接收短信平台(国内、国外)
2022上半年朋友圈都在传的10本书,找到了
企业MES制造执行系统的分类与应用
coming! Gaussdb (for Cassandra) new features appear
如何选择合适的自动化测试工具?
Seize Jay Chou
Recommend free online SMS receiving platform in 2022 (domestic and foreign)
初识缓存以及ehcache初体验「建议收藏」

>





