g2801_2900.s2885_rename_columns.solution.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java21 Show documentation
Show all versions of leetcode-in-java21 Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
# #Easy #2023_12_23_Time_467_ms_(68.13%)_Space_60.7_MB_(15.08%)
import pandas as pd
def renameColumns(students: pd.DataFrame) -> pd.DataFrame:
students.rename(columns={'id': 'student_id', 'first': 'first_name', 'last': 'last_name', 'age': 'age_in_years'}, inplace=True)
return students