全站数据
8 4 2 0 5 8 1

pandas如何对数组排序

小白读财经 | 教育先行,筑梦人生!         
问题更新日期:2024-05-09 09:09:54

问题描述

pandas如何对数组排序求高手给解答
精选答案
最佳答案

# 以数组 a 的从小到大的顺序为基准,对数组b进行重排序,并返回排序结果的索引数

import numpy as np

b = np.array([0,1,2,3,4,5,6])

index = np.lexsort((b, a))