将数量阵列调整到2048行
我正在寻找一种方法来调整具有 3 列和不同行的 NumPy 数组的大小(例如行数 = 3000, 5234, 2650,...)
我想做的是将行数设置为 2048,同时仍然有 3列。但删除的行应该是随机的。
我所做的是:
array_2 = array_1[::2, :]
但是使用这种方法,我只能将行数除以 to 。
我希望我能够清楚地表达我的问题。
I am looking for a way to resize NumPy arrays with 3 columns and different rows (e.g. number of rows = 3000, 5234, 2650,...)
What I am trying to do is set the number of rows to 2048 while still having 3 columns. But the deleted rows should be random.
What I did is:
array_2 = array_1[::2, :]
But with that method, I can only divide the number of rows e.g. by to.
I hope I was able to state my question clearly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论