mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3066",
|
||||
"questionFrontendId": "100007",
|
||||
"categoryTitle": "Algorithms",
|
||||
"questionFrontendId": "2881",
|
||||
"categoryTitle": "pandas",
|
||||
"boundTopicId": 2394353,
|
||||
"title": "Create a New Column",
|
||||
"titleSlug": "create-a-new-column",
|
||||
"content": "<pre>\nDataFrame <code>employees</code>\n+-------------+--------+\n| Column Name | Type. |\n+-------------+--------+\n| name | object |\n| salary | int. |\n+-------------+--------+\n</pre>\n\n<p>A company plans to provide its employees with a bonus.</p>\n\n<p>Write a solution to create a new column name <code>bonus</code> that contains the <strong>doubled values</strong> of the <code>salary</code> column.</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:</strong>\nDataFrame employees\n+---------+--------+\n| name | salary |\n+---------+--------+\n| Piper | 4548 |\n| Grace | 28150 |\n| Georgia | 1103 |\n| Willow | 6593 |\n| Finn | 74576 |\n| Thomas | 24433 |\n+---------+--------+\n<strong>Output:</strong>\n+---------+--------+--------+\n| name | salary | bonus |\n+---------+--------+--------+\n| Piper | 4548 | 9096 |\n| Grace | 28150 | 56300 |\n| Georgia | 1103 | 2206 |\n| Willow | 593 | 13186 |\n| Finn | 74576 | 149152 |\n| Thomas | 24433 | 48866 |\n+---------+--------+--------+\n<strong>Explanation:</strong> \nA new column bonus is created by doubling the value in the column salary.</pre>\n",
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"content": "<pre>\nDataFrame <code>employees</code>\n+-------------+--------+\n| Column Name | Type. |\n+-------------+--------+\n| name | object |\n| salary | int. |\n+-------------+--------+\n</pre>\n\n<p>A company plans to provide its employees with a bonus.</p>\n\n<p>Write a solution to create a new column name <code>bonus</code> that contains the <strong>doubled values</strong> of the <code>salary</code> column.</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:</strong>\nDataFrame employees\n+---------+--------+\n| name | salary |\n+---------+--------+\n| Piper | 4548 |\n| Grace | 28150 |\n| Georgia | 1103 |\n| Willow | 6593 |\n| Finn | 74576 |\n| Thomas | 24433 |\n+---------+--------+\n<strong>Output:</strong>\n+---------+--------+--------+\n| name | salary | bonus |\n+---------+--------+--------+\n| Piper | 4548 | 9096 |\n| Grace | 28150 | 56300 |\n| Georgia | 1103 | 2206 |\n| Willow | 6593 | 13186 |\n| Finn | 74576 | 149152 |\n| Thomas | 24433 | 48866 |\n+---------+--------+--------+\n<strong>Explanation:</strong> \nA new column bonus is created by doubling the value in the column salary.</pre>\n",
|
||||
"translatedTitle": "创建新列",
|
||||
"translatedContent": "<pre>\nDataFrame <code>employees</code>\n+-------------+--------+\n| Column Name | Type. |\n+-------------+--------+\n| name | object |\n| salary | int. |\n+-------------+--------+\n</pre>\n\n<p>一家公司计划为员工提供奖金。</p>\n\n<p>编写一个解决方案,创建一个名为 <code>bonus</code> 的新列,其中包含 <code>salary</code> 值的 <strong>两倍</strong>。</p>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p> </p>\n\n<p><b>示例 1:</b></p>\n\n<pre>\n<b>输入:</b>\nDataFrame employees\n+---------+--------+\n| name | salary |\n+---------+--------+\n| Piper | 4548 |\n| Grace | 28150 |\n| Georgia | 1103 |\n| Willow | 6593 |\n| Finn | 74576 |\n| Thomas | 24433 |\n+---------+--------+\n<b>输出:</b>\n+---------+--------+--------+\n| name | salary | bonus |\n+---------+--------+--------+\n| Piper | 4548 | 9096 |\n| Grace | 28150 | 56300 |\n| Georgia | 1103 | 2206 |\n| Willow | 593 | 13186 |\n| Finn | 74576 | 149152 |\n| Thomas | 24433 | 48866 |\n+---------+--------+--------+\n<b>解释:</b>\n通过将 salary 列中的值加倍创建了一个新的 bonus 列。</pre>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
@@ -28,7 +28,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"12\", \"totalSubmission\": \"13\", \"totalAcceptedRaw\": 12, \"totalSubmissionRaw\": 13, \"acRate\": \"92.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.6K\", \"totalSubmission\": \"1.8K\", \"totalAcceptedRaw\": 1626, \"totalSubmissionRaw\": 1838, \"acRate\": \"88.5%\"}",
|
||||
"hints": [
|
||||
"Consider using the `[]` brackets with the new column name at the left side of the assignment. The calculation of the value is done element-wise."
|
||||
],
|
||||
|
Reference in New Issue
Block a user