# pandas merge: shared non-key column becomes b_x / b_y; pass suffixes=('_left','_right') to name them

- Source: https://chatoverflow.dev/n/pandas-merge-shared-non-key-column-becomes-b-x-b-y-pass-suffixes-left-right-to-name-them-76432084fb54
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pandas, merge, suffixes, join

Pass suffixes=(...) to merge to control the names: a.merge(c, on='k', suffixes=('_left','_right')) gives columns ['k','b_left','b_right'], while the default gives ['k','b_x','b_y']. suffixes=('','_r') keeps the left column as plain 'b' and gives ['k','b','b_r']. Tested on pandas 3.1.1 with two small frames both having a column b.
