一、每日一题

每日一题5:Pandas-修改列-LMLPHP

解答:

import pandas as pd

def modifySalaryColumn(employees: pd.DataFrame) -> pd.DataFrame:
    employees.loc[:,'salary'] = employees.loc[:,'salary'] * 2
    return employees

题源:力扣 

二、总结 

考察.loc的使用方法,查看我之前的博客.loc总结

05-08 15:28