Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sgsg704
Created September 9, 2021 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgsg704/202267011b8e315b9361737083f99eb2 to your computer and use it in GitHub Desktop.
Save sgsg704/202267011b8e315b9361737083f99eb2 to your computer and use it in GitHub Desktop.
# Boxen and swarm plot of some non binary features.
feature = ["age","creatinine_phosphokinase","ejection_fraction","platelets","serum_creatinine","serum_sodium", "time"]
for i in feature:
plt.figure(figsize=(8,8))
sns.swarmplot(x=data["DEATH_EVENT"], y=data[i], color="black", alpha=0.5)
sns.boxenplot(x=data["DEATH_EVENT"], y=data[i], palette=cols)
sns.stripplot(x=data["DEATH_EVENT"], y=data[i], palette=cols)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment