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": "3063",
"questionFrontendId": "100004",
"categoryTitle": "Algorithms",
"questionFrontendId": "2891",
"categoryTitle": "pandas",
"boundTopicId": 2467482,
"title": "Method Chaining",
"titleSlug": "method-chaining",
"content": "<pre>\nDataFrame <code>animals</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| name | object |\n| species | object |\n| age | int |\n| weight | int |\n+-------------+--------+\n</pre>\n\n<p>Write a solution to list the names of animals that weigh <strong>strictly more than</strong> <code>100</code> kilograms.</p>\n\n<p>Return the&nbsp;animals sorted by weight in <strong>descending order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nDataFrame animals:\n+----------+---------+-----+--------+\n| name | species | age | weight |\n+----------+---------+-----+--------+\n| Tatiana | Snake | 98 | 464 |\n| Khaled | Giraffe | 50 | 41 |\n| Alex | Leopard | 6 | 328 |\n| Jonathan | Monkey | 45 | 463 |\n| Stefan | Bear | 100 | 50 |\n| Tommy | Panda | 26 | 349 |\n+----------+---------+-----+--------+\n<strong>Output:</strong> \n+----------+\n| name |\n+----------+\n| Tatiana |\n| Jonathan |\n| Tommy |\n| Alex |\n+----------+\n<strong>Explanation:</strong> \nAll animals weighing more than 100 should be included in the results table.\nTatiana&#39;s weight is 464, Jonathan&#39;s weight is 463, Tommy&#39;s weight is 349, and Alex&#39;s weight is 328.\nThe results should be sorted in descending order of weight.</pre>\n\n<p>&nbsp;</p>\n<p>In Pandas, <strong>method chaining</strong> enables us to&nbsp;perform operations on a DataFrame without breaking up each operation into a separate line or creating multiple temporary variables.&nbsp;</p>\n\n<p>Can you complete this&nbsp;task in just <strong>one line </strong>of code using method chaining?</p>\n",
"translatedTitle": null,
"translatedContent": null,
"translatedTitle": "方法链",
"translatedContent": "<pre>\nDataFrame <code>animals</code>\n+-------------+--------+\n| Column Name | Type |\n+-------------+--------+\n| name | object |\n| species | object |\n| age | int |\n| weight | int |\n+-------------+--------+\n</pre>\n\n<p>编写一个解决方案来列出体重 <strong>严格超过&nbsp;</strong>&nbsp;<code>100</code>&nbsp; 千克的动物的名称。</p>\n\n<p>按体重 <strong>降序</strong> 返回动物。</p>\n\n<p>返回结果格式如下示例所示。</p>\n\n<p>&nbsp;</p>\n\n<p><b>示例 1:</b></p>\n\n<pre>\n<b>输入:</b>\nDataFrame animals:\n+----------+---------+-----+--------+\n| name | species | age | weight |\n+----------+---------+-----+--------+\n| Tatiana | Snake | 98 | 464 |\n| Khaled | Giraffe | 50 | 41 |\n| Alex | Leopard | 6 | 328 |\n| Jonathan | Monkey | 45 | 463 |\n| Stefan | Bear | 100 | 50 |\n| Tommy | Panda | 26 | 349 |\n+----------+---------+-----+--------+\n<b>输出:</b>\n+----------+\n| name |\n+----------+\n| Tatiana |\n| Jonathan |\n| Tommy |\n| Alex |\n+----------+\n<b>解释:</b>\n所有体重超过 100 的动物都应包含在结果表中。\nTatiana 的体重为 464Jonathan 的体重为 463Tommy 的体重为 349Alex 的体重为 328。\n结果应按体重降序排序。</pre>\n\n<p>&nbsp;</p>\n\n<p>在 Pandas 中,<strong>方法链</strong> 允许我们在 DataFrame 上执行操作,而无需将每个操作拆分成单独的行或创建多个临时变量。</p>\n\n<p>你能用 <strong>一行</strong> 代码的方法链完成这个任务吗?</p>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 0,
"likes": 1,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -20,8 +20,15 @@
"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}",
"topicTags": [],
"companyTagStats": null,
"codeSnippets": [],
"stats": "{\"totalAccepted\": \"1\", \"totalSubmission\": \"1\", \"totalAcceptedRaw\": 1, \"totalSubmissionRaw\": 1, \"acRate\": \"100.0%\"}",
"codeSnippets": [
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef findHeavyAnimals(animals: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"1.2K\", \"totalSubmission\": \"1.6K\", \"totalAcceptedRaw\": 1182, \"totalSubmissionRaw\": 1601, \"acRate\": \"73.8%\"}",
"hints": [],
"solution": null,
"status": null,