I\'m trying to merge 2 DataFrames using concat
, on their DateTime Index, but it\'s not working as I expected. I copied some of this code from the example in the
You need axis=1:
pd.concat([df,df2], axis=1)
Output:
value 0
2015-02-04 444 222
2016-03-05 555 333
pass axis=1 to concatenate column-wise:
In [7]:
pd.concat([df,df2], axis=1)
Out[7]:
value 0
2015-02-04 444 222
2016-03-05 555 333
Alternatively you could've join
ed:
In [5]:
df.join(df2)
Out[5]:
value 0
2015-02-04 444 222
2016-03-05 555 333
or merge
d:
In [8]:
df.merge(df2, left_index=True, right_index=True)
Out[8]:
value 0
2015-02-04 444 222
2016-03-05 555 333