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
Normally, if we create a Series or DataFrame from a numpy array of non-ns datetime64, and the values are within the ns-range, we convert to datetime64[ns] (in sanitize_array).
However, this does not seem to happen if the array is not writeable:
In [9]: arr = np.array(['2020-01-01T00:00:00.000000'], dtype="datetime64[us]")
In [10]: pd.Series(arr)
Out[10]:
0 2020-01-01
dtype: datetime64[ns]
In [11]: arr.flags.writeable = False
In [12]: pd.Series(arr)
Out[12]:
0 2020-01-01 00:00:00
dtype: object