text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

dataset = pd.read_csv('../input/the-spotify-hit-predictor-dataset/dataset-of-90s.csv')

features_with_na = [feature for feature in dataset.columns if dataset[feature].isnull().sum() > 1]
features_with_na

dataset.isnull().sum()

numerical_feature = [feature for feature in dataset.columns if dataset[feature].dtypes != 'O']
numerical_feature

discrete_feature = [feature for feature in numerical_feature if len(dataset[feature].unique()) < 15]
discrete_feature

for feature in discrete_feature:
    data = dataset.copy()
    data.groupby(feature)['target'].median().plot.bar()
    plt.xlabel(feature)
    plt.ylabel('target')
    plt.show()