Learn practical skills, build real-world projects, and advance your career
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data=pd.read_csv('C:/Users/Windows/Downloads/original.csv')
data.head()
data.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 2000 entries, 0 to 1999 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 clientid 2000 non-null int64 1 income 2000 non-null float64 2 age 1997 non-null float64 3 loan 2000 non-null float64 4 default 2000 non-null int64 dtypes: float64(3), int64(2) memory usage: 78.2 KB
data.fillna(data['age'].mean(),inplace=True)

KNN: