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
In [5]: pd.to_datetime(['10/02/2014'], dayfirst=True)[0]
Out[5]: Timestamp('2014-02-10 00:00:00', tz=None)
In [6]: pd.to_datetime(np.asarray(['10/02/2014'], dtype='object'), dayfirst=True)[0]
Out[6]: Timestamp('2014-02-10 00:00:00', tz=None)
In [8]: pd.DatetimeIndex(np.asarray(['10/02/2014'], dtype='object'), dayfirst=True)[0]
Out[8]: Timestamp('2014-10-02 00:00:00', tz=None)
There seems to be a difference between to_datetime and DatetimeIndex.
Also, the other issue is about dayfirst not being strict, so no error for eg "10/14/2014". While here, it is just wrong even in a case that is perfectly possible for dayfirst.
assert pd.DatetimeIndex(['10/02/2014'], dayfirst=True) == pd.DatetimeIndex(np.asarray(['10/02/2014'], dtype=object), dayfirst=True)
The text was updated successfully, but these errors were encountered: