相关疑难解决方法(0)

按列对NumPy中的数组进行排序

如何在第n列中对NumPy中的数组进行排序?

例如,

a = array([[9, 2, 3],
           [4, 5, 6],
           [7, 0, 5]])
Run Code Online (Sandbox Code Playgroud)

我想按第二列对行进行排序,以便我回来:

array([[7, 0, 5],
       [9, 2, 3],
       [4, 5, 6]])
Run Code Online (Sandbox Code Playgroud)

python arrays sorting numpy scipy

295
推荐指数
7
解决办法
27万
查看次数

标签 统计

arrays ×1

numpy ×1

python ×1

scipy ×1

sorting ×1