Pandas DataFrame not merging on datetime index when using outer join results in NaT values
I'm integrating two systems and I'm stuck on something that should probably be simple. I'm trying to merge two DataFrames on a datetime index, but after performing an outer join, I'm seeing unexpected `NaT` values in the resulting DataFrame... Here are the details: I have two DataFrames, `df1` and `df2`, both indexed by a datetime column. I want to merge them while ensuring I capture all dates from both DataFrames, even if some dates don't exist in one of them. I'm using version 1.5.2 of pandas. Here's a snippet of my code: ```python import pandas as pd import numpy as np # Sample data index1 = pd.date_range('2023-01-01', periods=5, freq='D') df1 = pd.DataFrame({'A': range(5)}, index=index1) index2 = pd.date_range('2023-01-03', periods=5, freq='D') df2 = pd.DataFrame({'B': range(5, 10)}, index=index2) # Merging with outer join result = pd.merge(df1, df2, left_index=True, right_index=True, how='outer') print(result) ``` When I run this, I expect to see a complete timeline from January 1 to January 7, with `NaN` values filling where there is no data from either DataFrame. Instead, I see `NaT` values in the index, which is not what I anticipated: ``` A B 2023-01-01 0 NaN 2023-01-02 1 NaN 2023-01-03 2 5.0 2023-01-04 3 6.0 2023-01-05 4 7.0 2023-01-06 NaT 8.0 2023-01-07 NaT 9.0 ``` I've tried resetting the index and merging again, but it doesn't help. I've also checked for any potential timezone issues, but both DataFrames are in UTC. Is there something about how the merge function interacts with datetime indices that I'm missing? Any tips on how to resolve this would be much appreciated! I'm on Debian using the latest version of Python. This is happening in both development and production on CentOS. Thanks for your help in advance!