題目會給定兩個pandas DataFrame作為輸入,要求我們將兩張資料表,依照原有的順序串接在一起。
Example 1:
Input:
df1
+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
| 1 | Mason | 8 |
| 2 | Ava | 6 |
| 3 | Taylor | 15 |
| 4 | Georgia | 17 |
+------------+---------+-----+
df2
+------------+------+-----+
| student_id | name | age |
+------------+------+-----+
| 5 | Leo | 7 |
| 6 | Alex | 7 |
+------------+------+-----+
Output:
+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
| 1 | Mason | 8 |
| 2 | Ava | 6 |
| 3 | Taylor | 15 |
| 4 | Georgia | 17 |
| 5 | Leo | 7 |
| 6 | Alex | 7 |
+------------+---------+-----+
Explanation:
The two DataFramess are stacked vertically, and their rows are combined.
兩張資料表依照原有順序,沿著垂直方向,串接在一起。