1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-27 18:50:26 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/修改列 [modify-columns].html

43 lines
950 B
HTML
Raw Normal View History

2023-12-09 18:53:53 +08:00
<pre>
DataFrame <code>employees</code>
+-------------+--------+
| Column Name | Type |
+-------------+--------+
| name | object |
| salary | int |
+-------------+--------+
</pre>
<p>一家公司决定增加员工的薪水。</p>
<p>编写一个解决方案将每个员工的薪水乘以2来 <strong>修改</strong>&nbsp;<code>salary</code>&nbsp;列。</p>
<p>返回结果格式如下示例所示。</p>
<p>&nbsp;</p>
<p><b>示例 1:</b></p>
<pre>
<strong>输入:
</strong>DataFrame employees
+---------+--------+
| name | salary |
+---------+--------+
| Jack | 19666 |
| Piper | 74754 |
| Mia | 62509 |
| Ulysses | 54866 |
+---------+--------+
<strong>输出:
</strong>+---------+--------+
| name | salary |
+---------+--------+
| Jack | 39332 |
| Piper | 149508 |
| Mia | 125018 |
| Ulysses | 109732 |
+---------+--------+
<strong>解释:
</strong>每个人的薪水都被加倍。</pre>