📜  读取csv文件的列名python代码示例

📅  最后修改于: 2022-03-11 14:45:22.789000             🧑  作者: Mango

代码示例1
import pandas as pd
df = pd.read_csv('file.csv', names=['a', 'b', 'c'], header=None)
df.rename(columns = {'a':'A', 'b':'B', 'c':'C'}, inplace = True) 
df.to_csv('file.csv')