BUG: Did not expect new dtype datetime64[ns] to equal self.dtype datetime64[ns] #56502
Closed
2 of 3 tasks
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Needs Info
Clarification about behavior needed to assess issue
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Original code was:
change_date["latest_change_at"].fillna("2001-01-01T00:00:00Z", inplace=True)
This is my error:
Value '2001-01-01T00:00:00Z' has dtype incompatible with datetime64[ns], please explicitly cast to a compatible dtype first.
So I tried to change the values for the fillna to datetime64[ns] by running this:
change_date["latest_change_at"].fillna(np.datetime64('2001-01-01T00:00:00'), inplace=True)
Expected Behavior
This should cast.
Installed Versions
Pandas 2.1.4
The text was updated successfully, but these errors were encountered: