1# credit to the post in the source link
2# create dataset
3data = [31, 29, 28, 28, 27, 26, 26, 27, 27, 27, 28, 29, 30, 29, 30, 29, 28]
4
5# perform Mann-Kendall Trend Test
6import pymannkendall as mk
7mk.original_test(data)
8>>> Mann_Kendall_Test(trend='no trend', h=False, p=0.422586268671707,
9 z=0.80194241623, Tau=0.147058823529, s=20.0,
10 var_s=561.33333333, slope=0.0384615384615, intercept=27.692307692)
11
12# trend: increasing, decreasing, or no trend.
13# h: True if trend is present. False if no trend is present.
14# p: The p-value of the test. The lower the better
15##### Mann - Kendall parameters
16# z: The normalize test statistic.
17# Tau: Kendall Tau.
18# s: Mann-Kendal’s score
19# var_s: Variance S
20# slope: Theil-Sen estimator/slope
21# intercept: Intercept of Kendall-Theil Robust Line