Understanding Time Series Horizontal Merge Questions

Asked 1 years ago, Updated 1 years ago, 385 views

There are two CSV files: area1.csvarea2.csv
There is no item name in the time column, so
If I want to combine horizontally based on time, how can I modify it?
I would appreciate it if you could let me know!
df1=pd.read_csv(area1.csv,index_col=0)
df2=pd.read_csv(area2.csv,index_col=0)
df3=pd.merge([df1,df2], how="outer")
df3.to_csv(area3.csv,index=False,encoding='utf-8')

Enter a description of the image here

python pandas

2023-02-17 16:05

1 Answers

df3=pd.merge(df1,df2,left_index=True,right_index=True,how='outer')


2023-02-17 16:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.