1.修改列名字
把Dataframe格式的列名'class1'修改为'class_label'
data.rename(columns={"label":"true_label"},inplace=True) data.head()
2.调整列的顺序
df_train = df_train[['HappenTime','submit_time','happen_year_month_day']]
3.调整index为从1开始
df_train.index = range(1,len(df_train) + 1) # 将index改成从1开始
参考文献: