You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is fixed in current master (though I think I will add some tests in any event),
can you verify
In [6]: rows = []
In [7]: rows.append([pd.datetime(2010, 1, 1), 1])
In [8]: rows.append([pd.datetime(2010, 1, 2), 'hi']) # test col upconverts to obj
In [9]: df2_obj = pd.DataFrame.from_records(rows, columns=['date', 'test'])
In [10]: df2_obj.dtypes
Out[10]:
date datetime64[ns]
test object
dtype: object
Ints
In [12]: In [7]: rows.append([pd.datetime(2010, 1, 1), 1])
In [13]: In [8]: rows.append([pd.datetime(2010, 1, 2),1])
In [14]: df2_int = pd.DataFrame.from_records(rows, columns=['date', 'test'])
In [15]: df2_int.dtypes
Out[15]:
date datetime64[ns]
test int64
dtype: object
If the
'hi'
is changed to anint
thendf2_obj.date.dtype
is equal toM8[ns]
The text was updated successfully, but these errors were encountered: