I have a pandas DataFrame of a datetime series and a pandas DataFrame with a numbered index:
How do I set the index of the DataFrame with the numbered index to match the index of the DataFrame with the datetime series?
I have a pandas DataFrame of a datetime series and a pandas DataFrame with a numbered index:
How do I set the index of the DataFrame with the numbered index to match the index of the DataFrame with the datetime series?
If same length of both DataFrames
:
df1.index = df2.index
Or:
df1= df1.set_index(df2.index)