From af7e92b8814f1c73cd225825fe5ada47d2843a41 Mon Sep 17 00:00:00 2001 From: Dilipan Date: Mon, 27 Oct 2025 18:46:27 +0530 Subject: [PATCH] Add files via upload --- basic data cleaning2.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 basic data cleaning2.py diff --git a/basic data cleaning2.py b/basic data cleaning2.py new file mode 100644 index 00000000..18a62b90 --- /dev/null +++ b/basic data cleaning2.py @@ -0,0 +1,23 @@ +# Task #100: Basic Data Cleaning using pandas +import pandas as pd + +# Read dataset (you can replace this with your CSV path) +data = pd.read_csv("data.csv") + +# Show first few rows +print("Before Cleaning:\n", data.head()) + +# Drop rows with missing values +data_cleaned = data.dropna() + +# Rename columns (example) +data_cleaned = data_cleaned.rename(columns={'OldColumnName': 'NewColumnName'}) + +# Reset index +data_cleaned.reset_index(drop=True, inplace=True) + +# Save cleaned data +data_cleaned.to_csv("cleaned_data.csv", index=False) + +print("\nAfter Cleaning:\n", data_cleaned.head()) +print("\n✅ Data cleaned and saved as 'cleaned_data.csv'")