Explanation:
In Pandas, the rename() function is used to modify column names in a DataFrame. Syntax: df = df.rename({old_name: new_name}, axis='columns')
- A dictionary in the form
{old_name: new_name}is provided to rename selected columns. - The parameter
axis='columns'(oraxis=1) indicates that the changes apply to column labels.
