Skip to content

Instantly share code, notes, and snippets.

@saimadhu-polamuri
Created October 16, 2023 11:00
Show Gist options
  • Save saimadhu-polamuri/4ee4ea93e8d9b203b275b820154c668b to your computer and use it in GitHub Desktop.
Save saimadhu-polamuri/4ee4ea93e8d9b203b275b820154c668b to your computer and use it in GitHub Desktop.
from scipy.stats import ks_2samp
import numpy as np
# Generate two random samples from normal distributions
sample1 = np.random.normal(loc=0, scale=1, size=100)
sample2 = np.random.normal(loc=0.5, scale=1, size=100)
# Perform two-sample KS test
statistic, pvalue = ks_2samp(sample1, sample2)
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