Why pandas does not let me make a join on datetimeindex? Here is a small code block to produce the issue that i am having.
dti = pd.date_range('2019-01-01','2020-01-01')
df1 = pd.DataFrame({'date':dti})
df2 = pd.DataFrame({'date':dti})
df1.join(df2,on="date")
I tried to convert columns to datetime object first but still no luck.
dti = pd.date_range('2019-01-01','2020-01-01')
dto = pd.to_datetime(dti)
df1 = pd.DataFrame({'date':dto})
df2 = pd.DataFrame({'date':dto})
df1.join(df2,on="date")
Both of them are failing with below exception.
ValueError: You are trying to merge on datetime64[ns] and int64 columns. If you wish to proceed you should use pd.concat