[Python] 纯文本查看 复制代码
import pandas as pd
chengji=[[100,95,100,99],[90,98,99,100],[88,95,98,88],[99,98,97,87],[96.5,90,96,85],[94,94,93,91],[91, 99, 92, 87], [85, 88, 85, 90], [90, 92, 99, 88], [90, 88, 89, 81], [85, 89, 89, 82], [95, 87, 86, 88], [90, 97, 97, 98], [80, 92, 89, 98], [80, 98, 85, 81], [98, 88, 95, 92]]
data=pd.DataFrame(chengji,columns=['语文','英语','数学','政治'])
data1=data[['数学','语文','英语','政治']] #排序
data1=data1.reset_index(drop=True) #序列重建
data1.index.names=['序号'] #序列重命名
data1.index=data1.index+1 #序列从1开始
print (data1)