Skip to content

Instantly share code, notes, and snippets.

@saimadhu-polamuri
Created October 16, 2023 11:01
Show Gist options
  • Save saimadhu-polamuri/49d1b5475629577f77dbcb6955af31be to your computer and use it in GitHub Desktop.
Save saimadhu-polamuri/49d1b5475629577f77dbcb6955af31be to your computer and use it in GitHub Desktop.
from scipy.stats import kstest
import numpy as np
# Generate a random sample from a normal distribution
sample = np.random.normal(loc=0, scale=1, size=100)
# Perform goodness-of-fit KS test against a normal distribution
statistic, pvalue = kstest(sample, 'norm')
print('Test statistic:', statistic)
print('P-value:', pvalue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment