mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
42 lines
972 B
HTML
42 lines
972 B
HTML
|
<pre>
|
||
|
DataFrame <code>employees</code>
|
||
|
+-------------+--------+
|
||
|
| Column Name | Type |
|
||
|
+-------------+--------+
|
||
|
| name | object |
|
||
|
| salary | int |
|
||
|
+-------------+--------+
|
||
|
</pre>
|
||
|
|
||
|
<p>A company intends to give its employees a pay rise.</p>
|
||
|
|
||
|
<p>Write a solution to <strong>modify</strong> the <code>salary</code> column by multiplying each salary by 2.</p>
|
||
|
|
||
|
<p>The result format is in the following example.</p>
|
||
|
|
||
|
<p> </p>
|
||
|
<p><strong class="example">Example 1:</strong></p>
|
||
|
|
||
|
<pre>
|
||
|
<strong>Input:
|
||
|
</strong>DataFrame employees
|
||
|
+---------+--------+
|
||
|
| name | salary |
|
||
|
+---------+--------+
|
||
|
| Jack | 19666 |
|
||
|
| Piper | 74754 |
|
||
|
| Mia | 62509 |
|
||
|
| Ulysses | 54866 |
|
||
|
+---------+--------+
|
||
|
<strong>Output:
|
||
|
</strong>+---------+--------+
|
||
|
| name | salary |
|
||
|
+---------+--------+
|
||
|
| Jack | 39332 |
|
||
|
| Piper | 149508 |
|
||
|
| Mia | 125018 |
|
||
|
| Ulysses | 109732 |
|
||
|
+---------+--------+
|
||
|
<strong>Explanation:
|
||
|
</strong>Every salary has been doubled.</pre>
|