[LeetCode] Pandas / 2877. Create a DataFrame from List

2024. 7. 8. 14:30Coding/LeetCode-Pandas

문제 링크

https://leetcode.com/problems/create-a-dataframe-from-list/description/

 

문제

 

코드

import pandas as pd
def createDataframe(student_data: List[List[int]]) -> pd.DataFrame:
    return pd.DataFrame(student_data, columns=['student_id', 'age'])