当前位置:网站首页>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
边栏推荐
- U++4 接口 学习笔记
- y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
- U++ 游戏类 学习笔记
- HarmonyOS第四次培训
- 第一篇论文的写作流程
- Knapsack problem (01 knapsack, complete knapsack, dynamic programming)
- Flask project uses flask socketio exception: typeerror: function() argument 1 must be code, not str
- U++4 interface learning notes
- Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.
- ASP. Net MVC - resource cannot be found error - asp Net MVC – Resource Cannot be found error
猜你喜欢

Error: No named parameter with the name ‘foregroundColor‘

sublime使用技巧

Pointer and array are input in function to realize reverse order output

高手勿进!写给初中级程序员以及还在大学修炼的“准程序员”的成长秘籍

What changes will PMP certification bring?

基于Bevy游戏引擎和FPGA的双人游戏

pytest测试框架——数据驱动

ThinkPHP关联预载入with

记录一次压测经验总结

IMS data channel concept of 5g vonr+
随机推荐
批量归一化(标准化)处理
Development thoughts of adding new requirements in secondary development
[optimal web page width and its implementation] [recommended collection "
QT控件样式系列(一)之QSlider
Autowired注解用于List时的现象解析
《四》表单
Leetcode (46) - Full Permutation
Using thread class and runnable interface to realize the difference between multithreading
Scheduledexecutorservice timer
Pointer and array are input in function to realize reverse order output
线程同步的两个方法
高手勿进!写给初中级程序员以及还在大学修炼的“准程序员”的成长秘籍
Tencent cloud database public cloud market ranks top 2!
U++4 接口 学习笔记
QT simple layout box model with spring
NiO related knowledge points (I)
Addressable 预下载
pmp真的有用吗?
第一篇论文的写作流程
U++4 interface learning notes