mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
41 lines
1.1 KiB
HTML
41 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> </p>
|
|
<p><strong class="example">Example 1:</strong></p>
|
|
|
|
<pre>
|
|
<strong>Input:
|
|
</strong>+------------+---------+-----+
|
|
| student_id | name | age |
|
|
+------------+---------+-----+
|
|
| 32 | Piper | 5 |
|
|
| 217 | None | 19 |
|
|
| 779 | Georgia | 20 |
|
|
| 849 | Willow | 14 |
|
|
+------------+---------+-----+
|
|
<strong>Output:
|
|
</strong>+------------+---------+-----+
|
|
| student_id | name | age |
|
|
+------------+---------+-----+
|
|
| 32 | Piper | 5 |
|
|
| 779 | Georgia | 20 |
|
|
| 849 | Willow | 14 |
|
|
+------------+---------+-----+
|
|
<strong>Explanation:</strong>
|
|
Student with id 217 havs empty value in the name column, so it will be removed.</pre>
|