Skip to content

Instantly share code, notes, and snippets.

@kshirsagarsiddharth
Created January 3, 2022 07:22
Show Gist options
  • Save kshirsagarsiddharth/e1bcbb695e5aca25ae8c1750cb34cf1c to your computer and use it in GitHub Desktop.
Save kshirsagarsiddharth/e1bcbb695e5aca25ae8c1750cb34cf1c to your computer and use it in GitHub Desktop.
def univariate_hist_with_hue(x = 'person_age', hue = 'person_income'):
plt.figure(dpi = 130)
sns.set_style('whitegrid')
return sns.kdeplot(x = x, data = df, fill=True, palette = 'crest', hue = hue).set_title('Univariate visualization of Quantative Variable with hue')
D = interact(univariate_hist_with_hue,
x = widgets.Dropdown(
options = ['person_age','person_income','person_emp_length','loan_amnt','loan_int_rate','loan_percent_income','cb_person_cred_hist_length']
),
hue = widgets.Dropdown(
options = ['person_home_ownership', 'loan_intent', 'loan_grade','cb_person_default_on_file','loan_status']
)
)
interactive(children=(Dropdown(description='x', options=('person_age', 'person_income', 'person_emp_length', '…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment