Syntax
argsort(a, axis=-1, kind=’quicksort’, order=None)
返回 数组值 从小到大 的 索引值 。
实验代码
# coding: utf-8
import numpy as np
# 返回 数组值 从小到大 的 索引值
x = np.array([[20, 10, 30, 40],
[100, 200, 300, 400]])
print np.argsort(x)
argsort(a, axis=-1, kind=’quicksort’, order=None)
返回 数组值 从小到大 的 索引值 。
# coding: utf-8
import numpy as np
# 返回 数组值 从小到大 的 索引值
x = np.array([[20, 10, 30, 40],
[100, 200, 300, 400]])
print np.argsort(x)