1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/从表中创建 DataFrame [create-a-dataframe-from-list].html
2023-12-09 18:53:53 +08:00

32 lines
885 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>编写一个解决方案,基于名为&nbsp;&nbsp;<code>student_data</code>&nbsp;的二维列表&nbsp;<b>创建 </b>一个 DataFrame 。这个二维列表包含一些学生的 ID 和年龄信息。</p>
<p>DataFrame 应该有两列,&nbsp;<code>student_id</code>&nbsp;&nbsp;<code>age</code>,并且与原始二维列表的顺序相同。</p>
<p>返回结果格式如下示例所示。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<pre>
<strong>输入:
</strong>student_data:<strong>
</strong><code>[
[1, 15],
[2, 11],
[3, 11],
[4, 20]
]</code>
<b>输出:</b>
+------------+-----+
| student_id | age |
+------------+-----+
| 1 | 15 |
| 2 | 11 |
| 3 | 11 |
| 4 | 20 |
+------------+-----+
<b>解释:</b>
基于 student_data 创建了一个 DataFrame包含 student_id 和 age 两列。
</pre>