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
{{ message }}
Repository navigation
BUG: Silent overflow when casting large date strings to M8[ns] #9956
When converting date strings that exceed the maximum value for their precision to datetime64s, the resulting values silently overflow instead of erroring/warning.
Following the overflow warnings given for other types, I would have expected a warning or error here. Tested as far back as 1.11, still has the same issue.
In [1]: importnumpyasnpIn [2]: x=np.array(['4998-01-01 00:00:00'], dtype='O')
In [3]: x.astype('M8[ns]') # overflowsOut[3]: array(['2075-03-26T02:07:11.452241920'], dtype='datetime64[ns]')
In [4]: x.astype('M8[ms]') # no overflowOut[4]: array(['4998-01-01T00:00:00.000'], dtype='datetime64[ms]')
In [5]: np.__version__Out[5]: '1.13.3'
changed the title [-]Silent overflow when casting large date strings to `M8[ns]`[/-][+]BUG: Silent overflow when casting large date strings to `M8[ns]`[/+]on Nov 5, 2017
Activity
[-]Silent overflow when casting large date strings to `M8[ns]`[/-][+]BUG: Silent overflow when casting large date strings to `M8[ns]`[/+]