且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Numpy随机排列数组的列

更新时间:2023-11-18 23:09:16

在问我可能要改组转置数组时,

While asking I thought about maybe I could shuffle the transposed array:

 np.random.shuffle(np.transpose(r))

看起来确实可以完成.我希望通过评论了解这是否是实现此目标的好方法.

It looks like it does the job. I'd appreciate comments to know if it's a good way of achieving this.