I\'m trying to merge two dataframes which contain the same key column. Some of the other columns also have identical headers, although not an equal number of rows, and after
Not exactly the answer, but pd.merge provides an argument to help you decide which suffixes should be added to your overlapping columns:
merge_df = pd.merge(holding_df, invest_df, on='key', how='left', suffixes=('_holding', '_invest')).fillna(0)
More meaningful names could be helpful if you decide to keep both (or to check why the columns are kept).
See documentation for more reference.