3065. Display the First Three Rows
My accepted Python solution to LeetCode problem 3065, Display the First Three Rows, running in 264ms.
- Difficulty: Easy
- Python
- Runtime 264ms
- Memory 66.5MB
- 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 66.5MB, accepted 2026-01-02.
import pandas as pd
def selectFirstRows(employees: pd.DataFrame) -> pd.DataFrame:
return employees.head(3)