当前位置:网站首页>np. random. Shuffle and np Use swapaxis or transfer with caution
np. random. Shuffle and np Use swapaxis or transfer with caution
2022-07-07 05:17:00 【Fun of construction】
# y = np.transpose(y,(1,0,2))
# y = np.random.shuffle(y)
# y = np.transpose(y,(1,0,2))
These three lines of code will lead to ValueError: axes don't match array
Error of ,
Similarly, , If you use swapaxis–shuffle–swapaxis Similar errors will occur .
Avoid this problem .
And if you want to arrange a dimension randomly , have access to permutation+ Slicing scheme ,shuffle Just for axis 0 Random .
reference
https://www.cnblogs.com/zmbreathing/p/random_shuffle.html
边栏推荐
猜你喜欢
QT simple layout box model with spring
拿到PMP认证带来什么改变?
Weebly移动端网站编辑器 手机浏览新时代
10 distributed databases that take you to the galaxy
Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
Why do many people misunderstand technical debt
Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str
《四》表单
U++4 接口 学习笔记
Function pointer and pointer function in C language
随机推荐
《五》表格
Sublime tips
痛心啊 收到教训了
Why is the salary of test and development so high?
2039: [蓝桥杯2022初赛] 李白打酒加强版 (动态规划)
vector和类拷贝构造函数
U++4 interface learning notes
DBSync新增对MongoDB、ES的支持
Clickhouse (03) how to install and deploy Clickhouse
DFS,BFS以及图的遍历搜索
Array initialization of local variables
项目经理如何凭借NPDP证书逆袭?看这里
Knapsack problem unrelated to profit (depth first search)
Leetcode (46) - Full Permutation
3. Type of fund
SQL injection - secondary injection and multi statement injection
Why JSON is used for calls between interfaces, how fastjson is assigned, fastjson 1.2 [email protected] Mapping relatio
What changes will PMP certification bring?
《四》表单
Ansible overview and module explanation (you just passed today, but yesterday came to your face)