this entry collects the solution files i have for rename columns. i may expand it with a fuller write-up later, but the implementation files are already here.
available solution files
- Python
rename-columns/rename-columns.py
notes and solution files for rename columns.
this entry collects the solution files i have for rename columns. i may expand it with a fuller write-up later, but the implementation files are already here.
rename-columns/rename-columns.pyimport pandas as pd
def renameColumns(students: pd.DataFrame) -> pd.DataFrame:
students.rename(columns = {class="syntax-string">"id":class="syntax-string">"student_id", class="syntax-string">"first" :class="syntax-string">"first_name", class="syntax-string">"last" : class="syntax-string">"last_name", class="syntax-string">"age" : class="syntax-string">"age_in_years"}, inplace = True)
return students