1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/删去丢失的数据 [drop-missing-data].html
2023-12-09 18:53:53 +08:00

42 lines
1.0 KiB
HTML

<pre>
DataFrame students
+-------------+--------+
| Column Name | Type |
+-------------+--------+
| student_id | int |
| name | object |
| age | int |
+-------------+--------+
</pre>
<p><code>name</code> 列里有一些具有缺失值的行。</p>
<p>编写一个解决方案,删除具有缺失值的行。</p>
<p>返回结果格式如下示例所示。</p>
<p>&nbsp;</p>
<p><b>示例 1:</b></p>
<pre>
<strong>输入:
</strong>+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
| 32 | Piper | 5 |
| 217 | None | 19 |
| 779 | Georgia | 20 |
| 849 | Willow | 14 |
+------------+---------+-----+
<strong>输出:
</strong>+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
| 32 | Piper | 5 |
| 779 | Georgia | 20 |
| 849 | Willow | 14 |
+------------+---------+-----+
<b>解释:
</b>学号为 217 的学生所在行在 name 列中有空值,因此这一行将被删除。</pre>