wrong index name during read_csv if using usecols · Issue #4201 · pandas-dev/pandas (original) (raw)

Hi,

If I have a test.csv file looks like below

SecId    Time               Price    P2    P3
10000   2013-5-11       100      10     1
500       2013-5-12     101      11     1

if I read in the above file with the following code

df =pd.read_csv('test.csv', usecols=['Time', 'Price'], parse_dates=True, index_col=0)

then df.index.name will be SecId instead of Time