3069. Change Data Type
My accepted Python solution to LeetCode problem 3069, Change Data Type, running in 273ms.
- Difficulty: Easy
- Python
- Runtime 273ms
- Memory 66.7MB
- 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 273ms, memory 66.7MB, accepted 2026-01-02.
import pandas as pd
def changeDatatype(students: pd.DataFrame) -> pd.DataFrame:
students['grade'] = students['grade'].astype(int)
return students