-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.
Milestone
Description
tools.datetimes has to dig into IntegerArray internals in a way that in principle should be handled by IntegerArray.astype
ser = pd.Series(range(2), dtype="Int64")
arr = ser.array
>>> arr.astype("datetime64[ns]")
array(['1970-01-01T00:00:00.000000000', '1970-01-01T00:00:00.000000001'],
dtype='datetime64[ns]')
arr[-1] = pd.NA
>>> arr.astype("datetime64[ns]")
ValueError: cannot convert to 'datetime64[ns]'-dtype NumPy array with missing values. Specify an appropriate 'na_value' for this dtype.
Metadata
Metadata
Assignees
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.