Code Sample

A = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]})
B = pd.DataFrame({'a': [1, 2, 3], 'c': [7, 8, 9]})

def foo(A, B):
    C = A.merge(B, on=['a'])
    C['c']  # Where does c originate from?

Problem description

There is no way to explicitely specificy whether 'c' originates from A or B. This makes code harder to maintain. Better would be if I could write something like:

C = A.merge(B, on=['a'], always_suffix=True)
C['c_y]  # Obvious that C comes from B, because suffixes are always created

Comment From: jreback

this is a dupe of #17834