3062. Create a DataFrame from List
My accepted Python solution to LeetCode problem 3062, Create a DataFrame from List, running in 264ms.
- Difficulty: Easy
- Python
- Runtime 264ms
- Memory 65.8MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 264ms, memory 65.8MB, accepted 2026-01-02.
import pandas as pd
def createDataframe(student_data: List[List[int]]) -> pd.DataFrame:
return pd.DataFrame(student_data, columns=['student_id', 'age'])