Numpy 排序(sorting)、查询(searching)、计数(counting)

#排序(Sorting)

FunctionDescribe
sort(a[, axis, kind, order])Return a sorted copy of an array.
lexsort(keys[, axis])Perform an indirect sort using a sequence of keys.
argsort(a[, axis, kind, order])Returns the indices that would sort an array.
ndarray.sort([axis, kind, order])Sort an array, in-place.
msort(a)Return a copy of an array sorted along the first axis.
sort_complex(a)Sort a complex array using the real part first, then the imaginary part.
partition(a, kth[, axis, kind, order])Return a partitioned copy of an array.
argpartition(a, kth[, axis, kind, order])Perform an indirect partition along the given axis using the algorithm specified by the kind keyword.

#查询(Searching)

FunctionDescribe
argmax(a[, axis, out])Returns the indices of the maximum values along an axis.
nanargmax(a[, axis])Return the indices of the maximum values in the specified axis ignoring NaNs.
argmin(a[, axis, out])Returns the indices of the minimum values along an axis.
nanargmin(a[, axis])Return the indices of the minimum values in the specified axis ignoring NaNs.
argwhere(a)Find the indices of array elements that are non-zero, grouped by element.
nonzero(a)Return the indices of the elements that are non-zero.
flatnonzero(a)Return indices that are non-zero in the flattened version of a.
where(condition, [x, y])Return elements, either from x or y, depending on condition.
searchsorted(a, v[, side, sorter])Find indices where elements should be inserted to maintain order.
extract(condition, arr)Return the elements of an array that satisfy some condition.

#计数(Counting)

FunctionDescribe
count_nonzero(a[, axis])Counts the number of non-zero values in the array a.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值