pandas.read_csv() infers the types of columns, but I can't get it to infer any datetime or timedelta type (e.g. datetime64
, timedelta64
) for columns whose values seem like obvious datetimes and time deltas.
Here's an example CSV file:
datetime,timedelta,integer,number,boolean,string
20111230 00:00:00,one hour,10,1.6,True,Foobar
And some code to read it with pandas:
dataframe = pandas.read_csv(path)
The types of the columns on that dataframe come out as object, object, int, float, bool, object. They're all as I would expect except the first two columns, which I want to be datetime and timedelta.
Is it possible to get pandas to automatically detect datetime and timedelta columns?
(I don't want to have to tell pandas which columns are datetimes and timedeltas or tell it the formats, I want it to try and detect them automatically like it does for into, float and bool columns.)