Currently you first have to manually remove columns that don't exist in the df from the mappings.
For such usecases, it would be much nicer if there was an ignore_missing Parameter to rename, which defaults to False (mirroring the current behaviour).
Description
For people who work with column name mappings it would be very useful if there was an option to ignore missing columns on df.rename().
Currently the following fails because some columns in mappings don't exist in the DataFrame:
Currently you first have to manually remove columns that don't exist in the df from the mappings.
For such usecases, it would be much nicer if there was an
ignore_missing
Parameter to rename, which defaults toFalse
(mirroring the current behaviour).