1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-06 07:51:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -2,17 +2,17 @@
"data": {
"question": {
"questionId": "3073",
"questionFrontendId": "100014",
"categoryTitle": "Algorithms",
"questionFrontendId": "2890",
"categoryTitle": "pandas",
"boundTopicId": 2467495,
"title": "Reshape Data: Melt",
"titleSlug": "reshape-data-melt",
"content": "<pre>\nDataFrame <code>report</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| product | object |\n| quarter_1 | int |\n| quarter_2 | int |\n| quarter_3 | int |\n| quarter_4 | int |\n+-------------+--------+\n</pre>\n\n<p>Write a solution to <strong>reshape</strong> the data so that each row represents sales data for a product in a specific quarter.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:\n</strong>+-------------+-----------+-----------+-----------+-----------+\n| product | quarter_1 | quarter_2 | quarter_3 | quarter_4 |\n+-------------+-----------+-----------+-----------+-----------+\n| Umbrella | 417 | 224 | 379 | 611 |\n| SleepingBag | 800 | 936 | 93 | 875 |\n+-------------+-----------+-----------+-----------+-----------+\n<strong>Output:</strong>\n+-------------+-----------+-------+\n| product | quarter | sales |\n+-------------+-----------+-------+\n| Umbrella | quarter_1 | 417 |\n| SleepingBag | quarter_1 | 800 |\n| Umbrella | quarter_2 | 224 |\n| SleepingBag | quarter_2 | 936 |\n| Umbrella | quarter_3 | 379 |\n| SleepingBag | quarter_3 | 93 |\n| Umbrella | quarter_4 | 611 |\n| SleepingBag | quarter_4 | 875 |\n+-------------+-----------+-------+\n<strong>Explanation:</strong>\nThe DataFrame is reshaped from wide to long format. Each row represents the sales of a product in a quarter.\n</pre>\n",
"translatedTitle": null,
"translatedContent": null,
"translatedTitle": "重塑数据:融合",
"translatedContent": "<pre>\nDataFrame <code>report</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| product | object |\n| quarter_1 | int |\n| quarter_2 | int |\n| quarter_3 | int |\n| quarter_4 | int |\n+-------------+--------+\n</pre>\n\n<p>编写一个解决方案,将数据 <strong>重塑</strong> 成每一行表示特定季度产品销售数据的形式。</p>\n\n<p>结果格式如下例所示:</p>\n\n<p>&nbsp;</p>\n\n<p><strong class=\"example\">示例 1</strong></p>\n\n<pre>\n<strong>输入:\n</strong>+-------------+-----------+-----------+-----------+-----------+\n| product | quarter_1 | quarter_2 | quarter_3 | quarter_4 |\n+-------------+-----------+-----------+-----------+-----------+\n| Umbrella | 417 | 224 | 379 | 611 |\n| SleepingBag | 800 | 936 | 93 | 875 |\n+-------------+-----------+-----------+-----------+-----------+\n<strong>输出:</strong>\n+-------------+-----------+-------+\n| product | quarter | sales |\n+-------------+-----------+-------+\n| Umbrella | quarter_1 | 417 |\n| SleepingBag | quarter_1 | 800 |\n| Umbrella | quarter_2 | 224 |\n| SleepingBag | quarter_2 | 936 |\n| Umbrella | quarter_3 | 379 |\n| SleepingBag | quarter_3 | 93 |\n| Umbrella | quarter_4 | 611 |\n| SleepingBag | quarter_4 | 875 |\n+-------------+-----------+-------+\n<strong>解释:</strong>\nDataFrame 已从宽格式重塑为长格式。每一行表示一个季度内产品的销售情况。\n</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 0,
"likes": 1,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -28,7 +28,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"12\", \"totalSubmission\": \"13\", \"totalAcceptedRaw\": 12, \"totalSubmissionRaw\": 13, \"acRate\": \"92.3%\"}",
"stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"1.4K\", \"totalAcceptedRaw\": 1094, \"totalSubmissionRaw\": 1363, \"acRate\": \"80.3%\"}",
"hints": [
"Consider using a built-in function in pandas library to transform the data"
],