Skip to content

Instantly share code, notes, and snippets.

@kshirsagarsiddharth
Created January 3, 2022 07:20
Show Gist options
  • Save kshirsagarsiddharth/c344b9578adf3a7b56638eb74655d3cf to your computer and use it in GitHub Desktop.
Save kshirsagarsiddharth/c344b9578adf3a7b56638eb74655d3cf to your computer and use it in GitHub Desktop.
def scatter_plot_int_with_hue(x = 'person_age',y = 'person_income', hue = 'loan_grade'):
plt.figure(dpi = 120)
sns.set_style('whitegrid')
return sns.scatterplot(data = df, x = x,y = y, alpha = 0.6, hue = hue, cmap = 'Set2').set_title('Visualize Relation Between 2 Quantative Variables with Hue')
B = interact(scatter_plot_int_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']
),
y = 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