1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 23:41: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

@@ -3,13 +3,13 @@
"question": {
"questionId": "3068",
"questionFrontendId": "2885",
"categoryTitle": "Algorithms",
"categoryTitle": "pandas",
"boundTopicId": 2467494,
"title": "Rename Columns",
"titleSlug": "rename-columns",
"content": "<pre>\nDataFrame <code>students</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| id | int |\n| first | object |\n| last | object |\n| age | int |\n+-------------+--------+\n</pre>\n\n<p>Write a solution to rename the columns as follows:</p>\n\n<ul>\n\t<li><code>id</code> to <code>student_id</code></li>\n\t<li><code>first</code> to <code>first_name</code></li>\n\t<li><code>last</code> to <code>last_name</code></li>\n\t<li><code>age</code> to <code>age_in_years</code></li>\n</ul>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<pre>\n<strong class=\"example\">Example 1:</strong>\n<strong>Input:\n</strong>+----+---------+----------+-----+\n| id | first | last | age |\n+----+---------+----------+-----+\n| 1 | Mason | King | 6 |\n| 2 | Ava | Wright | 7 |\n| 3 | Taylor | Hall | 16 |\n| 4 | Georgia | Thompson | 18 |\n| 5 | Thomas | Moore | 10 |\n+----+---------+----------+-----+\n<strong>Output:</strong>\n+------------+------------+-----------+--------------+\n| student_id | first_name | last_name | age_in_years |\n+------------+------------+-----------+--------------+\n| 1 | Mason | King | 6 |\n| 2 | Ava | Wright | 7 |\n| 3 | Taylor | Hall | 16 |\n| 4 | Georgia | Thompson | 18 |\n| 5 | Thomas | Moore | 10 |\n+------------+------------+-----------+--------------+\n<strong>Explanation:</strong> \nThe column names are changed accordingly.</pre>\n",
"translatedTitle": null,
"translatedContent": null,
"translatedTitle": "重命名列",
"translatedContent": "<pre>\nDataFrame <code>students</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| id | int |\n| first | object |\n| last | object |\n| age | int |\n+-------------+--------+\n</pre>\n\n<p>编写一个解决方案,按以下方式重命名列:</p>\n\n<ul>\n\t<li><code>id</code>&nbsp;重命名为&nbsp;<code>student_id</code></li>\n\t<li><code>first</code>&nbsp;重命名为&nbsp;<code>first_name</code></li>\n\t<li><code>last</code>&nbsp;重命名为&nbsp;<code>last_name</code></li>\n\t<li><code>age</code>&nbsp;重命名为&nbsp;<code>age_in_years</code></li>\n</ul>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:\n</strong>+----+---------+----------+-----+\n| id | first | last | age |\n+----+---------+----------+-----+\n| 1 | Mason | King | 6 |\n| 2 | Ava | Wright | 7 |\n| 3 | Taylor | Hall | 16 |\n| 4 | Georgia | Thompson | 18 |\n| 5 | Thomas | Moore | 10 |\n+----+---------+----------+-----+\n<b>输出:</b>\n+------------+------------+-----------+--------------+\n| student_id | first_name | last_name | age_in_years |\n+------------+------------+-----------+--------------+\n| 1 | Mason | King | 6 |\n| 2 | Ava | Wright | 7 |\n| 3 | Taylor | Hall | 16 |\n| 4 | Georgia | Thompson | 18 |\n| 5 | Thomas | Moore | 10 |\n+------------+------------+-----------+--------------+\n<b>解释:</b>\n列名已相应更换。</pre>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 0,
@@ -28,7 +28,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"15\", \"totalSubmission\": \"15\", \"totalAcceptedRaw\": 15, \"totalSubmissionRaw\": 15, \"acRate\": \"100.0%\"}",
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"1.7K\", \"totalAcceptedRaw\": 1365, \"totalSubmissionRaw\": 1679, \"acRate\": \"81.3%\"}",
"hints": [
"Consider using a build-in function in pandas library with a dictionary to rename the columns as specified."
],