Trying to combine two dataframes based on a common column of the two dataframes and searching for a while, but have no luck.
import pandas as pd
df1 = pd.DataFrame ([[1,0.3],[2,0.5]],columns = ['Day','Dev'])
df1
Day Dev
0 1 0.3
1 2 0.5
df2 = pd.DataFrame ([[1,0.4],[3,0.6]],columns = ['Day','Dev'])
df2
Day Dev
0 1 0.4
1 3 0.6
Intend to combine like this:
Day Dev1 Dev2
0 1 0.3 0.4
1 2 0.5 NaN
2 3 NaN 0.6
Any suggestions are welcome. Thanks.