I have 2 dataframes with different timestamps and different lengths.
First Dataframe, df
, has 1054 rows and looks like this:
Second Dataframe, df_temp
, has 2629 rows and looks like this:
I have no clue where to begin. The time stamp is almost close and I know how to merge dataframes with similar index but not this one. Any help would be appreciated. Thank you!
df_merged=pd.concat([df,df_temp]).sort_index()
I tried this before as well. When I add these together the index is kind of sorted but it gives me NaN values for where the data is missing.
Can you try this ?
pd.concat([df,df_temp]).sort_index()
or
pd.concat([df,df_temp.rename(columns=dict(zip(df_temp.columns,df.columns)))]).sort_index()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.