FunctionRacerProblemsRace

Rename Columns

BeginnerpandasPython

df has columns nm and pr. Return a DataFrame with the same rows where nm is renamed to name and pr is renamed to price.

Example 1

df {"nm":["pen"],"pr":[2]}
returns {"columns":["name","price"],"rows":[["pen",2]]}

Same data, new column names.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems