Description
From mailing list:
The argument "parse_dates" will try to parse every column in the index.
Most of the times I have a dataset which looks like below and the first n columns will be used to set the multi-index.
Notice that my first column "date" is a date while the column "unitcode" is a integer.
If you use "parse_dates=True" than everything will be parsed.
Shouldn't it be me more logical that for parsing dates one has the option to explicitely parse certain columns like the index_col argument?
For the moment I uses read_csv without parsing, use the converters argument and then I use the set_index method. This works fine.
import pandas as pd
from StringIO import StringIO
data = '''date;destination;ventilationcode;unitcode;units
01/01/2010;P;P;50;1
01/01/2010;P;R;50;1
15/01/2010;P;P;50;1
01/05/2010;P;P;50;1'''
df = pd.read_csv(StringIO(data),sep=";",index_col = range(4),parse_dates=True)
print df.to_string()
patch
df = pd.read_csv(StringIO(data),sep=";",converters={'date':pd.datetools.dateutil.parser.parse})
df = df.set_index(col_or_cols=['date','destination','ventilationcode','unitcode'])
print df.to_string()