From 3facf239c2a36194e44bb332198619d7c33d6b76 Mon Sep 17 00:00:00 2001 From: Dilipan Date: Thu, 30 Oct 2025 18:02:57 +0530 Subject: [PATCH] Add basic data cleaning script using pandas Implement basic data cleaning using pandas to handle missing values and rename columns. --- basic cleaning | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 basic cleaning diff --git a/basic cleaning b/basic cleaning new file mode 100644 index 00000000..8d73e40e --- /dev/null +++ b/basic cleaning @@ -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'")