text_html_output_1.png
from sklearn.impute import SimpleImputer

import pandas as pd

df = pd.read_csv('/kaggle/input/music-genre-classification/train.csv')

df.shape

df.isna().sum()

df.duplicated().sum()

features = df.drop('Class', axis=1)
target = df['Class'].values

from sklearn.impute import SimpleImputer
nums_data = features.select_dtypes('number')
text_data = features.select_dtypes('object')
imputer = SimpleImputer(strategy='median')
nums_data_imp = imputer.fit_transform(nums_data)

nums_data_imp = pd.DataFrame(nums_data_imp, columns=imputer.get_feature_names_out())
nums_data_imp.isna().sum()