I have a dataframe with a range index and no data, in real data the index is a time range.
E.g.
df_main = pd.DataFrame(index = pd.RangeIndex(0,15,1))
See Fig1
And I have several dataframes which varying columns and indexes, I just want to join those on the main dataframe based on index:
df1 = pd.DataFrame({'value': [1, 2, 3, 5]}, index = pd.RangeIndex(0,4,1))
df2 = pd.DataFrame({'value': [5, 6, 7, 8]}, index = pd.RangeIndex(4,8,1))
df3 = pd.DataFrame({'value2': [9, 8, 7, 6]}, index = pd.RangeIndex(0,4,1))
df4 = pd.DataFrame({'value': [1, 2],'value2': [3, 4],'value3': [5, 6]}, index = pd.RangeIndex(10,12,1))
See Fig 2,3,4,5
I tried concat:
display(pd.concat([df_main,df1,df2,df3,df4]))
Which gives me the unwanted output you can see in Fig 6.
I also tried join which results in an error I did not understand:
ValueError: Indexes have overlapping values: Index(['value', 'value2'], dtype='object')
What I want to is the output you can see in Fig7.
