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 - 将熊猫数据框的第一行转换为列名 - 代码日志
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 - 将熊猫数据框的第一行转换为列名 - 代码日志