mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
update
This commit is contained in:
39
leetcode/problem/drop-missing-data.html
Normal file
39
leetcode/problem/drop-missing-data.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<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 | 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>
|
Reference in New Issue
Block a user