python pandas 读取excel文件时候如何读取指定的col
ringa_lee
ringa_lee 2017-04-18 10:03:42
0
1
572
ringa_lee
ringa_lee

ringa_lee

reply all (1)
洪涛

It seems that there was a bug before but it has been fixed now

Reference https://github.com/pandas-dev...

import pandas as pd df = pd.DataFrame({'A' : [1, 2, 3], 'B' : ['foo', 'bar', 'baz']}) df.to_excel('test.xlsx') print pd.read_excel('test.xlsx') # Out[28]: # A B # 0 1 foo # 1 2 bar # 2 3 baz print pd.read_excel('test.xlsx', names=['B','A']) # B A # 0 1 foo # 1 2 bar # 2 3 baz

It is the function of renaming the column name

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!