I have multiple pandas data frame objects cost1, cost2, cost3 ....
- They have different column names (and number of columns) but have some in common.
- Number of columns is fairly large in each data frame, hence handpicking the common columns manually will be painful.
How can I append rows from all of these data frames into one single data frame while retaining elements from only the common column names?
As of now I have
frames=[cost1,cost2,cost3]
new_combined = pd.concat(frames, ignore_index=True)
This obviously contains columns which are not common across all data frames.