BUG: in read_csv, keep_date_cols doesn't result in correct dtype · Issue #13378 · pandas-dev/pandas (original) (raw)
>>> import pandas
>>> import io
>>> data = """A
20150908
20150909
"""
>>> t=pandas.read_csv(io.StringIO(data))
>>> t.dtypes
A int64
dtype: object
>>> t=pandas.read_csv(io.StringIO(data),parse_dates={'date':['A']},keep_date_col=True)
>>> t.dtypes
date datetime64[ns]
A object
dtype: object
The second time, the datatype of the column 'A' should also be int64.