当前位置:网站首页>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
边栏推荐
- Leetcode minimum difference in student scores
- Development thoughts of adding new requirements in secondary development
- When knative meets webassembly
- Linkedblockingqueue source code analysis - initialization
- Weebly移动端网站编辑器 手机浏览新时代
- ClickHouse(03)ClickHouse怎么安装和部署
- Weebly mobile website editor mobile browsing New Era
- [PHP SPL notes]
- Addressable 预下载
- Autowired注解用于List时的现象解析
猜你喜欢

Full link voltage test: the dispute between shadow database and shadow table

Auto. JS get all app names of mobile phones

U++4 interface learning notes

Harmonyos fourth training

《五》表格

Basic knowledge of road loss of 3GPP channel model

Why do many people misunderstand technical debt

【问道】编译原理

10 distributed databases that take you to the galaxy

y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
随机推荐
When knative meets webassembly
Techniques d'utilisation de sublime
Longest common subsequence (LCS) (dynamic programming, recursive)
PMP证书有没有必要续期?
Window scheduled tasks
Ansible报错:“msg“: “Invalid/incorrect password: Permission denied, please try again.“
与利润无关的背包问题(深度优先搜索)
Weebly mobile website editor mobile browsing New Era
线程池的创建与使用
ScheduledExecutorService定时器
Ansible中的inventory主機清單(預祝你我有數不盡的鮮花和浪漫)
Autowired注解用于List时的现象解析
Y58. Chapter III kubernetes from entry to proficiency - continuous integration and deployment (Sany)
What changes will PMP certification bring?
app内嵌h5---iphone软键盘遮挡输入文字
【QT】自定义控件-Loading
Linkedblockingqueue source code analysis - initialization
LabVIEW在打开一个新的引用,提示内存已满
National meteorological data / rainfall distribution data / solar radiation data /npp net primary productivity data / vegetation coverage data
Longest palindrome substring (dynamic programming)