text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

df_drug = pd.read_csv('../input/drugsets/drug200.csv')
df_drug

name_cols = ['Sex', 'Drug', 'BP', 'Cholesterol']

name_cols = ['Sex', 'BP', 'Cholesterol']
for name_col in name_cols:
    print('\n')
    plt.figure(dpi=200)
    df_Dr = df_drug.groupby(['Drug', name_col]).size().reset_index(name='Count')
    print(df_Dr)
    sns.barplot(x='Drug', y='Count', hue=name_col, data=df_Dr)
    plt.title(str(name_col) + '--Drugs')
    plt.show()