題目會給定一個pandas DataFrame作為輸入,要求我們在原有的資料表上,建立一個新的column叫做"bonus",初始化成"salary"欄位兩倍的數值。
也就是說,新的"bonus"紅利欄位的數值,是原本"salary"薪水欄位的兩倍。
Example 1:
Input:
DataFrame employees
+---------+--------+
| name | salary |
+---------+--------+
| Piper | 4548 |
| Grace | 28150 |
| Georgia | 1103 |
| Willow | 6593 |
| Finn | 74576 |
| Thomas | 24433 |
+---------+--------+
Output:
+---------+--------+--------+
| name | salary | bonus |
+---------+--------+--------+
| Piper | 4548 | 9096 |
| Grace | 28150 | 56300 |
| Georgia | 1103 | 2206 |
| Willow | 6593 | 13186 |
| Finn | 74576 | 149152 |
| Thomas | 24433 | 48866 |
+---------+--------+--------+
Explanation:
A new column bonus is created by doubling the value in the column salary.
每一位員工的紅利bonus都是原本薪水salary欄位的兩倍