mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
批量更新数据
This commit is contained in:
@@ -12,12 +12,12 @@
|
||||
"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> 重命名为 <code>student_id</code></li>\n\t<li><code>first</code> 重命名为 <code>first_name</code></li>\n\t<li><code>last</code> 重命名为 <code>last_name</code></li>\n\t<li><code>age</code> 重命名为 <code>age_in_years</code></li>\n</ul>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p> </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,
|
||||
"likes": 1,
|
||||
"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}",
|
||||
"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, \"cangjie\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
@@ -28,7 +28,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"1.7K\", \"totalAcceptedRaw\": 1367, \"totalSubmissionRaw\": 1681, \"acRate\": \"81.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.4K\", \"totalSubmission\": \"5.4K\", \"totalAcceptedRaw\": 4440, \"totalSubmissionRaw\": 5415, \"acRate\": \"82.0%\"}",
|
||||
"hints": [
|
||||
"Consider using a build-in function in pandas library with a dictionary to rename the columns as specified."
|
||||
],
|
||||
@@ -40,7 +40,7 @@
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"]}",
|
||||
"envInfo": "{\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
|
Reference in New Issue
Block a user