mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 16:01:41 +08:00
update
This commit is contained in:
41
leetcode/problem/modify-columns.html
Normal file
41
leetcode/problem/modify-columns.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<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>
|
Reference in New Issue
Block a user