Created
November 7, 2020 06:14
-
-
Save yuyasugano/267bc7be9f954f48f4e9e78dcbdaa3bd to your computer and use it in GitHub Desktop.
3 ways to do test of normality with Scipy library in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# https://docs.scipy.org/doc/numpy-1.15.0/reference/routines.random.html | |
a = np.random.randn(1000) # conforms to the normal distribution | |
b = np.random.rand(1000) # random values in 0 to 1 | |
fig = plt.figure(figsize=(10, 5)) | |
ax1 = fig.add_subplot(1, 2, 1) | |
ax2 = fig.add_subplot(1, 2, 2) | |
ax1.hist(a, bins=100) | |
ax2.hist(b, bins=100) | |
fig.tight_layout() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment