当前位置:网站首页>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
- U++ 元数据说明符 学习笔记
- Longest common subsequence (LCS) (dynamic programming, recursive)
- 【问道】编译原理
- 《二》标签
- 10 distributed databases that take you to the galaxy
- Simulate thread communication
- LinkedBlockingQueue源码分析-初始化
- Full link voltage test: the dispute between shadow database and shadow table
- Development thoughts of adding new requirements in secondary development
猜你喜欢
Techniques d'utilisation de sublime
一文搞懂常见的网络I/O模型
Ansible中的inventory主机清单(预祝你我有数不尽的鲜花和浪漫)
AOSP ~binder communication principle (I) - Overview
Mysql database (basic)
Understand common network i/o models
10 distributed databases that take you to the galaxy
How to choose an offer and what factors should be considered
Basic knowledge of road loss of 3GPP channel model
Leetcode (417) -- Pacific Atlantic current problem
随机推荐
Longest palindrome substring (dynamic programming)
Linkedblockingqueue source code analysis - initialization
Ansible中的inventory主機清單(預祝你我有數不盡的鮮花和浪漫)
ThinkPHP关联预载入with
【PHP SPL笔记】
y58.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三一)
QT simple layout box model with spring
Leetcode (417) -- Pacific Atlantic current problem
与利润无关的背包问题(深度优先搜索)
【问道】编译原理
How to choose an offer and what factors should be considered
Dbsync adds support for mongodb and ES
[opencv] image morphological operation opencv marks the positions of different connected domains
最长回文子串(动态规划)
How to design API interface and realize unified format return?
【最佳网页宽度及其实现】「建议收藏」
带你遨游银河系的 10 种分布式数据库
U++4 interface learning notes
拿到PMP认证带来什么改变?
Why do many people misunderstand technical debt