Renaming a Specific Column in Pandas

Importing and Parsing

import pandas as pd
df = pd.read_csv(‘file_name.csv’)
df.head()

Check the column’s name you want to change, and then:

df.rename(columns={‘old_name’:’new_name’}, inplace=True)

原文链接:Renaming a Specific Column in Pandas

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
More grow up more lonely, more grow up more uneasy.
越长大越孤单 ,越长大越不安
评论 抢沙发

请登录后发表评论

    暂无评论内容