1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/数据选取 [select-data].html

39 lines
922 B
HTML
Raw Normal View History

2023-12-09 18:53:53 +08:00
<pre>
DataFrame students
+-------------+--------+
| Column Name | Type |
+-------------+--------+
| student_id | int |
| name | object |
| age | int |
+-------------+--------+
</pre>
<p>编写一个解决方案,选择&nbsp;<code>student_id = 101</code>&nbsp;的学生的 name 和 age 并输出。</p>
<p>返回结果格式如下示例所示。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre>
<b>输入:</b>
+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
| 101 | Ulysses | 13 |
| 53 | William | 10 |
| 128 | Henry | 6 |
| 3 | Henry | 11 |
+------------+---------+-----+
<b>输出:</b>
+---------+-----+
| name | age |
+---------+-----+
| Ulysses | 13 |
+---------+-----+
<strong>解释:
</strong>学生 Ulysses 的 student_id = 101所以我们输出了他的 name 和 age。</pre>