BUG: max on axis=1
returns wrong values on type datetime64[ns]
when NaT
is present in values
#60646
Open
2 of 3 tasks
Labels
Bug
Datetime
Datetime data dtype
Dtype Conversions
Unexpected or buggy dtype conversions
Reduction Operations
sum, mean, min, max, etc.
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
The max (axis=1) of a DataFrame of one column should return that column (type
pd.Series
).However, when the
dtype
isdatetime64[ns]
and the column contains aNaT
, there are small differences with the original and returned column.In the MWE the difference is 21 nanoseconds.
Note: This only happens if there is a
NaT
in column values.Expected Behavior
Expected behavior is to print
Installed Versions
The text was updated successfully, but these errors were encountered: