mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 02:41:42 +08:00
update
This commit is contained in:
39
leetcode-cn/problem (Chinese)/填充缺失值 [fill-missing-data].html
Normal file
39
leetcode-cn/problem (Chinese)/填充缺失值 [fill-missing-data].html
Normal file
@@ -0,0 +1,39 @@
|
||||
<pre>
|
||||
DataFrame <code>products</code>
|
||||
+-------------+--------+
|
||||
| Column Name | Type |
|
||||
+-------------+--------+
|
||||
| name | object |
|
||||
| quantity | int |
|
||||
| price | int |
|
||||
+-------------+--------+
|
||||
</pre>
|
||||
|
||||
<p>编写一个解决方案,在 <code>quantity</code> 列中将缺失的值填充为 <code><strong>0</strong></code>。</p>
|
||||
|
||||
<p>返回结果如下示例所示。</p>
|
||||
|
||||
<p> </p>
|
||||
<strong class="example">示例 1:</strong>
|
||||
|
||||
<pre>
|
||||
<strong>输入:
|
||||
</strong>+-----------------+----------+-------+
|
||||
| name | quantity | price |
|
||||
+-----------------+----------+-------+
|
||||
| Wristwatch | 32 | 135 |
|
||||
| WirelessEarbuds | None | 821 |
|
||||
| GolfClubs | None | 9319 |
|
||||
| Printer | 849 | 3051 |
|
||||
+-----------------+----------+-------+
|
||||
<strong>输出:
|
||||
</strong>+-----------------+----------+-------+
|
||||
| name | quantity | price |
|
||||
+-----------------+----------+-------+
|
||||
| Wristwatch | 32 | 135 |
|
||||
| WirelessEarbuds | 0 | 821 |
|
||||
| GolfClubs | 0 | 9319 |
|
||||
| Printer | 849 | 3051 |
|
||||
+-----------------+----------+-------+
|
||||
<b>解释:</b>
|
||||
Toaster 和 Headphones 的数量被填充为 0。</pre>
|
Reference in New Issue
Block a user