""" Hunter Schafer CSE 163 AX A file that contains some CSE 163 specific helper functions You do not need to understand how these functions are implemented, but you should be able to use the ones we described in class! """ import pandas as pd from typing import TypedDict Earthquake = TypedDict( "Earthquake", { "id": str, "year": int, "month": int, "day": int, "latitude": float, "longitude": float, "name": str, "magnitude": float, }, ) def parse(file_name: str) -> list[Earthquake]: """ Reads the CSV with the given file_name and returns it as a list of dictionaries. The list will have a dictionary for each row, and each dictionary will have a key for each column. """ df = pd.read_csv(file_name) return [Earthquake(row) for row in df.to_dict("records")]