API: allow DataFrame.rename to take a list-like of colums · Issue #14829 · pandas-dev/pandas (original) (raw)

This is closely related to #12392, but I think separate issue. Proposal would be to be able to pass a list-like to DataFrame.rename to make method-chaining easier. I think it would also be consistent with #11980 (Series rename)

df = pd.DataFrame({'a': [1,2], 'b': [3, 4]})

make this

df = df.rename(columns=['j', 'k'])

equivalent to

df.columns = ['j', 'k']