I have two dataframes:
>>>import import pandas as pd
>>>df1:
DD_PRICE
DATE
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 -4.476
>>>df2:
CAPI_PRICE
DATE
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 3.516
2013-09-19 20:55:00 -4.476
Now when I run:
joint_df = df1.join((df2), how='outer')
joint_df looks like this:
DD_PRICE CAPI_PRICE
DATE
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 -4.476
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 -4.476
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 -4.476
2013-09-19 20:55:00 -4.476 3.516
2013-09-19 20:55:00 -4.476 3.516
2013-09-19 20:55:00 -4.476 3.516
2013-09-19 20:55:00 -4.476 -4.476
This isnt what I want...
Ideally I want joint_df to look like this:
DD_PRICE CAPI_PRICE
DATE
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 3.516 3.516
2013-09-19 20:55:00 -4.476 -4.476
How do I get this done? Tried different combos of merge and join parameters but I can't get it to work!
df1['CAPI_PRICE'] = df2['CAPI_PRICE'].values?df = pd.concat([df1, df2], axis=1)does not work?