How can I force a suffix on a merge or join. I understand it\'s possible to provide one if there is a collision but in my case I\'m merging df1 with df2 which doesn\'t cause an
Pandas merge will give the new columns a suffix when there is already a column with the same name, When i need to force the new columns with a suffix, i create an empty column with the name of the column that i want to join.
df["colName"] = "" #create empty column
df.merge(right = "df1", suffixes = ("_a","_b"))
You can later drop the empty column.
You could do the same for more than one columns, or for every column in df.columns.values