This Google Colab notebook focuses on exploring, cleaning, and preprocessing a credit-related dataset (train 2.csv).
The goal is to prepare the data for downstream machine learning modeling โ handling missing values, encoding categorical features, and engineering new numerical variables such as credit history age in months.
- Imports the dataset using Pandas.
- Displays dataset info, shape, summary statistics, and missing value counts.
-
Checks for missing (
NaNandnull) values across all features. -
Investigates specific columns such as:
Payment_BehaviourType_of_LoanCredit_History_Age
-
Uses Regular Expressions (regex) to convert the
"Credit_History_Age"string (e.g.,"22 Years and 3 Months") into a single numeric column (months). -
Drops unnecessary or redundant columns:
["Name", "SSN", "ID", "Customer_ID", "Credit_History_Age"]
- Separates numerical and categorical columns for later use in model training and encoding.
Make sure the following libraries are installed (already included in Google Colab):
import pandas as pd
import numpy as np
import re-
Open in Google Colab Click this link or upload the
.ipynbfile to Colab. -
Upload your dataset Replace
"train 2.csv"with your own dataset file or upload via Colabโs file manager. -
Run all cells Go to
Runtime > Run allto execute the preprocessing pipeline. -
Inspect the cleaned dataframe The notebook prints summary stats and data samples for validation.
After running the notebook:
- Youโll get a cleaned Pandas DataFrame ready for model training.
- Categorical and numerical columns are clearly separated.
- Invalid or redundant columns are dropped.
- Credit history values are transformed into consistent numeric formats.
- Apply Label Encoding or One-Hot Encoding to categorical columns.
- Implement outlier detection and scaling.
- Integrate ML models for classification or regression on the processed data.
Armen-Aris Shahinyan Student & Software Engineer Intern โ combining data science with philosophical precision โ๏ธ