📅  最后修改于: 2022-03-11 14:45:53.285000             🧑  作者: Mango
# credit to the post in the source link
# create dataset
data = [31, 29, 28, 28, 27, 26, 26, 27, 27, 27, 28, 29, 30, 29, 30, 29, 28]
# perform Mann-Kendall Trend Test
import pymannkendall as mk
mk.original_test(data)
>>> Mann_Kendall_Test(trend='no trend', h=False, p=0.422586268671707,
z=0.80194241623, Tau=0.147058823529, s=20.0,
var_s=561.33333333, slope=0.0384615384615, intercept=27.692307692)
# trend: increasing, decreasing, or no trend.
# h: True if trend is present. False if no trend is present.
# p: The p-value of the test. The lower the better
##### Mann - Kendall parameters
# z: The normalize test statistic.
# Tau: Kendall Tau.
# s: Mann-Kendal’s score
# var_s: Variance S
# slope: Theil-Sen estimator/slope
# intercept: Intercept of Kendall-Theil Robust Line