Pandas有两种排序方式,它们分别是 - 按标签 按实际值 import pandas as pd import numpy as np df=pd.DataFrame(np.random.randn(10,2),index=[1,4,6,2,3,5,9,8,0,7],columns=['col2','col1']) print (df) 输出结果: col2 col1 1.069838 0.096230 -0.542406 -0.219829 -0.071661 0.392091 1.399…