Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 784 Bytes

pandas.md

File metadata and controls

41 lines (29 loc) · 784 Bytes

Pandas

Use pandas to solve problems

  1. Create Data Frame From List

Description

[Easy] Create a DataFrame from 2 2D list called student_data. This 2D list contains student IDs and ages. The DataFrame should have two columns, student_id and age, and be in the same order as the original 2D list.

Example

student_data = [
    [1, 15],
    [2, 11],
    [3, 11],
    [4, 20]
]

Output:

+------------+-----+
| student_id | age |
+------------+-----+
| 1          | 15  |
| 2          | 11  |
| 3          | 11  |
| 4          | 20  |
+------------+-----+

Implementation