One - One Code All

Blog Content

Python库pandas的DataFrame进行多列排序多条件排序sort_values

Python 统计学-科学计算   2014-04-05 08:42:00

对dataframe先排一列,若有相同再根据另一列排。



test.sort_values(by=['a', 'b'], acsending=[Flase, True])


按顺序对应好。


上一篇:pandas之排序函数sort_values("col")
下一篇:np.argsort()查找dataframe第一大第二大排序的元素topN

The minute you think of giving up, think of the reason why you held on so long.