Skip to content

Instantly share code, notes, and snippets.

@Knk00
Last active July 4, 2020 12:57
Show Gist options
  • Save Knk00/934a404be23939b03201e5c4fee07200 to your computer and use it in GitHub Desktop.
Save Knk00/934a404be23939b03201e5c4fee07200 to your computer and use it in GitHub Desktop.
from scipy.stats import kruskal
def seasonality_test(series):
seasoanl = False
idx = np.arange(len(series.index)) % 12
H_statistic, p_value = kruskal(series, idx)
if p_value <= 0.05:
seasonal = True
return seasonal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment