mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3072",
|
||||
"questionFrontendId": "100013",
|
||||
"categoryTitle": "Algorithms",
|
||||
"questionFrontendId": "2889",
|
||||
"categoryTitle": "pandas",
|
||||
"boundTopicId": 2467493,
|
||||
"title": "Reshape Data: Pivot",
|
||||
"titleSlug": "reshape-data-pivot",
|
||||
"content": "<pre>\nDataFrame <code>weather</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| city | object |\n| month | object |\n| temperature | int |\n+-------------+--------+\n</pre>\n\n<p>Write a solution to <strong>pivot</strong> the data so that each row represents temperatures for a specific month, and each city is a separate column.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<pre>\n<strong class=\"example\">Example 1:</strong>\n<strong>Input:</strong>\n+--------------+----------+-------------+\n| city | month | temperature |\n+--------------+----------+-------------+\n| Jacksonville | January | 13 |\n| Jacksonville | February | 23 |\n| Jacksonville | March | 38 |\n| Jacksonville | April | 5 |\n| Jacksonville | May | 34 |\n| ElPaso | January | 20 |\n| ElPaso | February | 6 |\n| ElPaso | March | 26 |\n| ElPaso | April | 2 |\n| ElPaso | May | 43 |\n+--------------+----------+-------------+\n<strong>Output:</strong><code>\n+----------+--------+--------------+\n| month | ElPaso | Jacksonville |\n+----------+--------+--------------+\n| April | 2 | 5 |\n| February | 6 | 23 |\n| January | 20 | 13 |\n| March | 26 | 38 |\n| May | 43 | 34 |\n+----------+--------+--------------+</code>\n<strong>Explanation:\n</strong>The table is pivoted, each column represents a city, and each row represents a specific month.</pre>\n",
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"translatedTitle": "数据重塑:透视",
|
||||
"translatedContent": "<pre>\nDataFrame <code>weather</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| city | object |\n| month | object |\n| temperature | int |\n+-------------+--------+\n</pre>\n\n<p>编写一个解决方案,以便将数据 <strong>旋转</strong>,使得每一行代表特定月份的温度,而每个城市都是一个单独的列。</p>\n\n<p>输出结果格式如下示例所示。</p>\n\n<p> </p>\n<b>示例 1:</b>\n\n<pre>\n<b>输入:</b>\n+--------------+----------+-------------+\n| city | month | temperature |\n+--------------+----------+-------------+\n| Jacksonville | January | 13 |\n| Jacksonville | February | 23 |\n| Jacksonville | March | 38 |\n| Jacksonville | April | 5 |\n| Jacksonville | May | 34 |\n| ElPaso | January | 20 |\n| ElPaso | February | 6 |\n| ElPaso | March | 26 |\n| ElPaso | April | 2 |\n| ElPaso | May | 43 |\n+--------------+----------+-------------+\n<code><b>输出:</b>\n+----------+--------+--------------+\n| month | ElPaso | Jacksonville |\n+----------+--------+--------------+\n| April | 2 | 5 |\n| February | 6 | 23 |\n| January | 20 | 13 |\n| March | 26 | 38 |\n| May | 43 | 34 |\n+----------+--------+--------------+</code>\n<strong>解释:\n</strong>表格被旋转,每一列代表一个城市,每一行代表特定的月份。</pre>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"likes": 1,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -28,7 +28,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11\", \"totalSubmission\": \"11\", \"totalAcceptedRaw\": 11, \"totalSubmissionRaw\": 11, \"acRate\": \"100.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"1.5K\", \"totalAcceptedRaw\": 1130, \"totalSubmissionRaw\": 1506, \"acRate\": \"75.0%\"}",
|
||||
"hints": [
|
||||
"Consider using a built-in function in pandas library to transform the data"
|
||||
],
|
||||
|
Reference in New Issue
Block a user