mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
59 lines
3.9 KiB
JSON
59 lines
3.9 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "3075",
|
|
"questionFrontendId": "2883",
|
|
"boundTopicId": null,
|
|
"title": "Drop Missing Data",
|
|
"titleSlug": "drop-missing-data",
|
|
"content": "<pre>\nDataFrame students\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| student_id | int |\n| name | object |\n| age | int |\n+-------------+--------+\n</pre>\n\n<p>There are some rows having missing values in the <code>name</code> column.</p>\n\n<p>Write a solution to remove the rows with missing values.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:\n</strong>+------------+-------+-----+\n| student_id | name | age |\n+------------+-------+-----+\n| 32 | Piper | 5 |\n| 217 | Grace | 19 |\n| 779 | None | 20 |\n| 849 | None | 14 |\n+------------+-------+-----+\n<strong>Output:\n</strong>+------------+-------+-----+\n| student_id | name | age |\n+------------+-------+-----+\n| 32 | Piper | 5 |\n| 217 | Grace | 19 |\n+------------+-------+-----+\n<strong>Explanation:</strong> \nStudents with ids 779 and 849 have empty values in the name column, so they will be removed.</pre>\n",
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": false,
|
|
"difficulty": "Easy",
|
|
"likes": 7,
|
|
"dislikes": 1,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"exampleTestcases": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"age\"]},\"rows\":{\"students\":[[32,\"Piper\",5],[217,\"Grace\",19],[779,null,20],[849,null,14]]}}",
|
|
"categoryTitle": "Algorithms",
|
|
"contributors": [],
|
|
"topicTags": [],
|
|
"companyTagStats": null,
|
|
"codeSnippets": [
|
|
{
|
|
"lang": "Pandas",
|
|
"langSlug": "pythondata",
|
|
"code": "import pandas as pd\n\ndef dropMissingData(students: pd.DataFrame) -> pd.DataFrame:\n ",
|
|
"__typename": "CodeSnippetNode"
|
|
}
|
|
],
|
|
"stats": "{\"totalAccepted\": \"270\", \"totalSubmission\": \"295\", \"totalAcceptedRaw\": 270, \"totalSubmissionRaw\": 295, \"acRate\": \"91.5%\"}",
|
|
"hints": [
|
|
"Consider using a build-in function in pandas library to remove the rows with missing values based on specified data."
|
|
],
|
|
"solution": {
|
|
"id": "2108",
|
|
"canSeeDetail": true,
|
|
"paidOnly": false,
|
|
"hasVideoSolution": false,
|
|
"paidOnlyVideo": true,
|
|
"__typename": "ArticleNode"
|
|
},
|
|
"status": null,
|
|
"sampleTestCase": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"age\"]},\"rows\":{\"students\":[[32,\"Piper\",5],[217,\"Grace\",19],[779,null,20],[849,null,14]]}}",
|
|
"metaData": "{\n \"pythondata\": [\n \"students = pd.DataFrame([], columns=['student_id', 'name', 'age']).astype({'student_id':'Int64', 'name':'object', 'age':'Int64'})\"\n ],\n \"database\": true,\n \"name\": \"dropMissingData\",\n \"languages\": [\n \"pythondata\"\n ]\n}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [],
|
|
"enableRunCode": true,
|
|
"enableTestMode": false,
|
|
"enableDebugger": true,
|
|
"envInfo": "{\"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"]}",
|
|
"libraryUrl": null,
|
|
"adminUrl": null,
|
|
"challengeQuestion": null,
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |