当前位置:网站首页>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
边栏推荐
猜你喜欢
Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.
Leetcode(417)——太平洋大西洋水流问题
Ansible overview and module explanation (you just passed today, but yesterday came to your face)
Techniques d'utilisation de sublime
记录一次压测经验总结
c语言神经网络基本代码大全及其含义
人体传感器好不好用?怎么用?Aqara绿米、小米之间到底买哪个
Analysis -- MySQL statement execution process & MySQL architecture
Harmonyos fourth training
Error: No named parameter with the name ‘foregroundColor‘
随机推荐
2039: [蓝桥杯2022初赛] 李白打酒加强版 (动态规划)
pytest测试框架——数据驱动
Knapsack problem (01 knapsack, complete knapsack, dynamic programming)
y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
[QT] custom control loading
U++ 游戏类 学习笔记
如何设计 API 接口,实现统一格式返回?
Complete code of C language neural network and its meaning
第一篇论文的写作流程
DFS, BFS and traversal search of Graphs
Why is the salary of test and development so high?
window定时计划任务
【最佳网页宽度及其实现】「建议收藏」
ASP. Net MVC - resource cannot be found error - asp Net MVC – Resource Cannot be found error
全链路压测:影子库与影子表之争
Using thread class and runnable interface to realize the difference between multithreading
Scheduledexecutorservice timer
Dbsync adds support for mongodb and ES
Test interview | how much can you answer the real test interview question of an Internet company?
一文搞懂常见的网络I/O模型