From 37ce10f12825e9e7d64eb3b84058de8b161304f7 Mon Sep 17 00:00:00 2001 From: Drew Giffin Date: Sun, 19 Oct 2025 13:41:30 -0400 Subject: [PATCH] Missing data is reported and cleaned --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index 1df2d97..a8e35c3 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,7 @@ data_path = "student_lifestyle_dataset.csv" def main(): df = load_data() inspect_data(df) + df_clean = clean_data(df) def load_data(): df = pd.read_csv(data_path, encoding="ascii", delimiter=",") @@ -23,4 +24,12 @@ def inspect_data(df): print(df.describe(include="all")) print("\n") +def clean_data(df): + print("Missing values:") + print(df.isnull().sum()) + print("\n") + + df_clean = df.dropna(inplace=False) + return df_clean + main() \ No newline at end of file