网站更新内容:请访问: https://bigdata.ministep.cn/

pandas将第一行设置为header

将第一行设置为header

df_v2 = df_v1.rename(columns=df_v1.iloc[0]).drop(df_v1.index[0])
df_v2.head()

How to Convert First Row to Header Column in Pandas DataFrame
python - 将熊猫数据框的第一行转换为列名 - 代码日志

posted @ 2022-04-06 20:44  ministep88  阅读(1160)  评论(0编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/