[LeetCode] Pandas / 2881. Create a new column

2024. 7. 8. 14:41Coding/LeetCode-Pandas

문제 링크

https://leetcode.com/problems/create-a-new-column/description/

 

문제

 

코드

import pandas as pd

def createBonusColumn(employees: pd.DataFrame) -> pd.DataFrame:
    employees['bonus'] = employees['salary']*2
    return employees