Is there a good way to concatenate a list of DataFrames where the columns are not regular between DataFrames?
The desired outcome is to match up all columns that are a match but to keep the ones that have no match off to the side. The reason you would want to keep the unmatched columns is because while there may not be a match on a given column between the 1st and 2nd dataframes in the list there may be a match between the 1st and 3rd. Thus discarding prematurely on the first lack of match would not be ideal.
And example is:
print list(datalist[0].columns)
>>>[u'1', u'2', u'3']print list(datalist[1].columns)
>>>[u'1', u'2', u'4']print list(datalist[2].columns)
>>>[u'2', u'3', u'4']
Where the output would be a dataframe like (stylistically represented here):
1 2 3 -
1 2 - 4
- 2 3 4