this is assignment Python given by Aadi foundation ( Training classes )
This project demonstrates basic data cleaning and preparation techniques using Python and pandas. The dataset used is a sample of customer data, which contains missing values, duplicates, and potential outliers.
The dataset contains the following fields:
CustomerID: Unique ID of the customer.Name: Name of the customer.Age: Age of the customer (with missing values).Gender: Gender of the customer.PurchaseAmount: Amount spent by the customer (with missing values).City: City of residence (with missing values).
- Remove Duplicate Records: Duplicates are removed based on the
CustomerID. - Handle Missing Values:
- Missing
Agevalues are filled with the average age. - Missing
PurchaseAmountvalues are filled with the median purchase amount. - Missing
Cityvalues are filled with 'Unknown'.
- Missing
- Outlier Detection: Outliers in the
PurchaseAmountcolumn were detected using the IQR method, but none were removed in this sample. - Data Type Correction: The data types of columns were checked, and all were found correct.
- Install the necessary libraries:
pip install pandas
- Run the Python script or the Jupyter notebook.
- The cleaned dataset will be printed and saved as a CSV file (
cleaned_data.csv).
data_cleaning.py: Python script containing the data cleaning code.cleaned_data.csv: The cleaned version of the dataset.README.md: Explanation of the assignment.