Library(15)
-
[LeetCode] Pandas / 2879. Display the first three rows
문제 링크https://leetcode.com/problems/display-the-first-three-rows/description/ 문제 코드import pandas as pddef selectFirstRows(employees: pd.DataFrame) -> pd.DataFrame: return employees.head(3)
2024.07.08 -
[LeetCode] Pandas / 2878. Get the size of a DataFrame
문제 링크https://leetcode.com/problems/get-the-size-of-a-dataframe/ 문제 코드import pandas as pddef getDataframeSize(players: pd.DataFrame) -> List[int]: return [players.shape[0], players.shape[1]]
2024.07.08 -
[LeetCode] Pandas / 2877. Create a DataFrame from List
문제 링크https://leetcode.com/problems/create-a-dataframe-from-list/description/ 문제 코드import pandas as pddef createDataframe(student_data: List[List[int]]) -> pd.DataFrame: return pd.DataFrame(student_data, columns=['student_id', 'age'])
2024.07.08