Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
DatetimeIndex.union is returning an incorrect result. Since this method is used by MultiIndex.concat, it leads to unexpected errors when combining several MultiIndex DataFrames/Series that have a datetime64[us] level.
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] 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
DatetimeIndex.union
is returning an incorrect result. Since this method is used byMultiIndex.concat
, it leads to unexpected errors when combining several MultiIndex DataFrames/Series that have adatetime64[us]
level.Expected Behavior
DatetimeIndex(['2024-05-11', '2024-05-12', '2024-05-13'], dtype='datetime64[us]', name='Date', freq=None)
Installed Versions