Pandas中DataFrame修改列名:使用 rename
df = pd.read_csv('I:/Papers/consumer/codeandpaper/TmallData/result01-part.csv') df.rename(columns={'time_stamp':'session_id'},inplace=True) print(df) df.to_csv('I:/Papers/consumer/codeandpaper/TmallData/result01-part-rename.csv')