当前位置:网站首页>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
边栏推荐
- 咋吃都不胖的朋友,Nature告诉你原因:是基因突变了
- Redis cluster and expansion
- Reinforcement learning - learning notes 8 | Q-learning
- 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
- Hutool - lightweight DB operation solution
- POJ 1182: food chain (parallel search) [easy to understand]
- 數據驗證框架 Apache BVal 再使用
- 链式二叉树的基本操作(C语言实现)
- Redis
猜你喜欢
如何给“不卖笔”的晨光估值?
Comparison and selection of kubernetes Devops CD Tools
50亿,福建又诞生一只母基金
前首富,沉迷种田
如何选择合适的自动化测试工具?
In the first half of 2022, I found 10 books that have been passed around by my circle of friends
二叉树的基本概念和性质
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%
Zhong Xuegao wants to remain innocent in the world
Pasqal首席技术官:模拟量子计算率先为工业带来量子优势
随机推荐
Golang client server login
【塔望方法论】塔望3W消费战略 - U&A研究法
In 2021, the national average salary was released. Have you reached the standard?
2022.07.02
Realize payment function in applet
In the first half of 2022, I found 10 books that have been passed around by my circle of friends
PTA 1102 teaching Super Champion volume
Nat address translation
Big Ben (Lua)
来了!GaussDB(for Cassandra)新特性亮相
SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
LeetCode 497(C#)
"Decryption" Huawei machine vision Corps: Huawei is moving up and the industry is moving forward
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
2022上半年朋友圈都在传的10本书,找到了
The top of slashdata developer tool is up to you!!!
链式二叉树的基本操作(C语言实现)
POJ 1182: food chain (parallel search) [easy to understand]
2022-07-04 matlab读取视频帧并保存
RISCV64