LeetCode solutions

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

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 264ms, memory 65.8MB, accepted 2026-01-02.

python
import pandas as pd

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

Source