test2023h5's picture
Upload 180 files
d95db82 verified
raw
history blame contribute delete
264 Bytes
import pandas as pd
if __name__ == "__main__":
raw_data = "raw/mpg.csv"
df = pd.read_csv(raw_data, na_values="?")
origin_map = {1: "usa", 2: "europe", 3: "japan"}
df["origin"] = df["origin"].map(origin_map)
df.to_csv("mpg.csv", index=False)