text_plain_output_4.png text_plain_output_3.png image_output_4.png text_plain_output_2.png text_plain_output_1.png image_output_3.png image_output_2.png image_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:
    df_Dr = df_drug.groupby(['Drug', name_col]).size().reset_index(name='Count')

fig, axes = plt.subplots(1, 2, figsize=(9,6))
sns.swarmplot(ax=axes[0], x = "Drug", y = 'Age', data = df_drug, color = "green")
# plt.legend(df_drug['Drug'].value_counts().index)
sns.swarmplot(ax=axes[1], x = "Drug", y = "Na_to_K", data = df_drug)
# plt.legend(df_drug['Drug'].value_counts().index)

df_drug.corr()

clipped_Na_to_K = BoxplotOutlierClipper().fit_transform(df_drug['Na_to_K'])
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(15, 5))
df_drug['Na_to_K'].hist(bins=50, ax=axes[0])
clipped_Na_to_K.hist(bins=50, ax=axes[1])