mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 11:08:15 +08:00
55 lines
3.8 KiB
JSON
55 lines
3.8 KiB
JSON
|
{
|
||
|
"data": {
|
||
|
"question": {
|
||
|
"questionId": "3062",
|
||
|
"questionFrontendId": "2877",
|
||
|
"categoryTitle": "Algorithms",
|
||
|
"boundTopicId": 2467481,
|
||
|
"title": "Create a DataFrame from List",
|
||
|
"titleSlug": "create-a-dataframe-from-list",
|
||
|
"content": "<p>Write a solution to <strong>create</strong> a DataFrame from a 2D list called <code>student_data</code>. This 2D list contains the IDs and ages of some students.</p>\n\n<p>The DataFrame should have two columns, <code>student_id</code> and <code>age</code>, and be in the same order as the original 2D list.</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>student_data:<strong>\n</strong><code>[\n [1, 15],\n [2, 11],\n [3, 11],\n [4, 20]\n]</code>\n<strong>Output:</strong>\n+------------+-----+\n| student_id | age |\n+------------+-----+\n| 1 | 15 |\n| 2 | 11 |\n| 3 | 11 |\n| 4 | 20 |\n+------------+-----+\n<strong>Explanation:</strong>\nA DataFrame was created on top of student_data, with two columns named <code>student_id</code> and <code>age</code>.\n</pre>\n",
|
||
|
"translatedTitle": null,
|
||
|
"translatedContent": null,
|
||
|
"isPaidOnly": false,
|
||
|
"difficulty": "Easy",
|
||
|
"likes": 0,
|
||
|
"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 createDataframe(student_data: List[List[int]]) -> pd.DataFrame:\n ",
|
||
|
"__typename": "CodeSnippetNode"
|
||
|
}
|
||
|
],
|
||
|
"stats": "{\"totalAccepted\": \"17\", \"totalSubmission\": \"17\", \"totalAcceptedRaw\": 17, \"totalSubmissionRaw\": 17, \"acRate\": \"100.0%\"}",
|
||
|
"hints": [
|
||
|
"Consider using a built-in function in pandas library and specifying the column names within it."
|
||
|
],
|
||
|
"solution": null,
|
||
|
"status": null,
|
||
|
"sampleTestCase": "[[1,15],[2,11],[3,11],[4,20]]",
|
||
|
"metaData": "{\n \"name\": \"create_a_dataframe\",\n \"params\": [\n {\n \"name\": \"student_data\",\n \"type\": \"list<list<integer>>\"\n }\n ],\n \"return\": {\n \"type\": \"DataFrame\"\n },\n \"data\": true,\n \"manual\": true\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": "[[1,15],[2,11],[3,11],[4,20]]",
|
||
|
"__typename": "QuestionNode"
|
||
|
}
|
||
|
}
|
||
|
}
|