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-cn/originData/select-data.json
2023-12-09 19:57:46 +08:00

55 lines
5.0 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"data": {
"question": {
"questionId": "3074",
"questionFrontendId": "2880",
"categoryTitle": "pandas",
"boundTopicId": 2467487,
"title": "Select Data",
"titleSlug": "select-data",
"content": "<pre>\nDataFrame students\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| student_id | int |\n| name | object |\n| age | int |\n+-------------+--------+\n\n</pre>\n\n<p>Write a solution to select the name and age of the student with <code>student_id = 101</code>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<pre>\n<strong>Example 1:\nInput:</strong>\n+------------+---------+-----+\n| student_id | name | age |\n+------------+---------+-----+\n| 101 | Ulysses | 13 |\n| 53 | William | 10 |\n| 128 | Henry | 6 |\n| 3 | Henry | 11 |\n+------------+---------+-----+\n<strong>Output:</strong>\n+---------+-----+\n| name | age | \n+---------+-----+\n| Ulysses | 13 |\n+---------+-----+\n<strong>Explanation:\n</strong>Student Ulysses has student_id = 101, we select the name and age.</pre>\n",
"translatedTitle": "数据选取",
"translatedContent": "<pre>\nDataFrame students\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| student_id | int |\n| name | object |\n| age | int |\n+-------------+--------+\n\n</pre>\n\n<p>编写一个解决方案,选择&nbsp;<code>student_id = 101</code>&nbsp;的学生的 name 和 age 并输出。</p>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>\n+------------+---------+-----+\n| student_id | name | age |\n+------------+---------+-----+\n| 101 | Ulysses | 13 |\n| 53 | William | 10 |\n| 128 | Henry | 6 |\n| 3 | Henry | 11 |\n+------------+---------+-----+\n<b>输出:</b>\n+---------+-----+\n| name | age | \n+---------+-----+\n| Ulysses | 13 |\n+---------+-----+\n<strong>解释:\n</strong>学生 Ulysses 的 student_id = 101所以我们输出了他的 name 和 age。</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 1,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"contributors": [],
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
"topicTags": [],
"companyTagStats": null,
"codeSnippets": [
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef selectData(students: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"1.8K\", \"totalSubmission\": \"2.5K\", \"totalAcceptedRaw\": 1823, \"totalSubmissionRaw\": 2456, \"acRate\": \"74.2%\"}",
"hints": [
"Consider applying both row and column filtering to select the desired data."
],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"age\"]},\"rows\":{\"students\":[[101,\"Ulysses\",13],[53,\"William\",10],[128,\"Henry\",6],[3,\"Henry\",11]]}}",
"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\": \"selectData\",\n \"languages\": [\n \"pythondata\"\n ]\n}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [],
"enableRunCode": true,
"envInfo": "{\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"age\"]},\"rows\":{\"students\":[[101,\"Ulysses\",13],[53,\"William\",10],[128,\"Henry\",6],[3,\"Henry\",11]]}}",
"__typename": "QuestionNode"
}
}
}