2020
10-01
10-01
Pandas读取csv时如何设置列名
1.csv文件自带列标题importpandasaspddf_example=pd.read_csv('Pandas_example_read.csv')#等同于:df_example=pd.read_csv('Pandas_example_read.csv',header=0)2.csv文件有列标题,但是想自己换成别的列标题2.1和2.2效果都是一样的,读取文件,并且改列名2.1在读数之后自定义标题df_example=pd.read_csv('Pandas_example_read.csv')df_example.columns=['A','B','C']2.2在读数的同时自定义标题df_example=p...
继续阅读 >