2885. Rename Columns

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2885

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