Skip to content

Instantly share code, notes, and snippets.

@jurand71
Created July 3, 2022 05:20
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 jurand71/709ca4a5f185b981a9f542f7b90a5d31 to your computer and use it in GitHub Desktop.
Save jurand71/709ca4a5f185b981a9f542f7b90a5d31 to your computer and use it in GitHub Desktop.
# Function for checking Gaussian distribution
import seaborn as sns
import scipy.stats as stats
sns.set_theme()
def Gaussian_distribution_check(data, variable):
fig = plt.figure(figsize=(15,5), dpi=300)
ax1 = fig.add_subplot(1,2,1)
sns.histplot(data[variable], kde=True, ax=ax1)
ax2 = fig.add_subplot(1,2,2)
stats.probplot(data[variable], dist="norm", plot=ax2)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment