1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode/problem/drop-missing-data.html
2023-10-05 03:40:12 +08:00

40 lines
1.1 KiB
HTML

<pre>
DataFrame students
+-------------+--------+
| Column Name | Type |
+-------------+--------+
| student_id | int |
| name | object |
| age | int |
+-------------+--------+
</pre>
<p>There are some rows having missing values in the <code>name</code> column.</p>
<p>Write a solution to remove the rows with missing values.</p>
<p>The result format is in the following example.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:
</strong>+------------+-------+-----+
| student_id | name | age |
+------------+-------+-----+
| 32 | Piper | 5 |
| 217 | Grace | 19 |
| 779 | None | 20 |
| 849 | None | 14 |
+------------+-------+-----+
<strong>Output:
</strong>+------------+-------+-----+
| student_id | name | age |
+------------+-------+-----+
| 32 | Piper | 5 |
| 217 | Grace | 19 |
+------------+-------+-----+
<strong>Explanation:</strong>
Students with ids 779 and 849 have empty values in the name column, so they will be removed.</pre>