The data I am working with resembles this:
import pandas as pd
df1 = pd.DataFrame({'A' : ['1960-01-01','1961-01-01','1962-01-01','1963-01-01'], 'B1' : [10,20,15,25], 'C1' : [100,50,45,105], 'D1' : [-30,-50,-25,-10]})
df2 = pd.DataFrame({'A' : ['1962-01-01','1963-01-01','1964-01-01','1965-01-01'], 'B2' : [120,250,105,205], 'C2' : [10,5,4.5,10], 'D2' : [-3,-5,-205,-1]})
The Output would be like this:
df = pd.DataFrame({'A' : ['1960-01-01','1961-01-01','1962-01-01','1963-01-01','1964-01-01','1965-01-01'], 'B1' : [10,20,15,25,'NaN','NaN'], 'B2' : ['NaN','NaN',120,250,105,205]})
The Date column 'A' would have to be common. There are several such data frames that need to be merged. I tried pandas.concat, merge and did not get useful results. The records that do not have corresponding values in the other data frame goes missing etc.