BUG: scipy.stats.theilslopes returns invalid data when input data is np.uint8 #19678
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.stats
Milestone
Describe your issue.
``
Expected result:
linregress = LinregressResult(slope=-0.08117408906882585, intercept=212.77543859649109, rvalue=-0.14521616256311687, pvalue=0.3777456213641338, stderr=0.09092294431311998, intercept_stderr=182.21245386044583) theilslopes = (0.0, 52.0, -0.2, 0.1388888888888889) siegelslopes= (-0.07448275862068965, 201.11448275862068) linregress = LinregressResult(slope=0.7799595141700404, intercept=-1526.3721997300943, rvalue=0.648915022489458, pvalue=7.885128179731413e-06, stderr=0.1503448757858782, intercept_stderr=301.2958824556652) theilslopes = (0.6923076923076923, -1350.3846153846152, 0.41379310344827586, 1.2307692307692308) siegelslopes= (0.980072463768116, -1927.0851449275362) linregress = LinregressResult(slope=-1.130971659919028, intercept=2291.15951417004, rvalue=-0.7989778176023127, pvalue=1.0820717823130094e-09, stderr=0.13994295315037716, intercept_stderr=280.4501007599699) theilslopes = (-1.0434782608695652, 2123.1304347826085, -1.3333333333333333, -0.5) siegelslopes= (-1.0947293447293447, 2218.258547008547) linregress = LinregressResult(slope=0.02186234817813765, intercept=7.469905533063432, rvalue=0.07626971562528158, pvalue=0.6444538083463693, stderr=0.04698691899214995, intercept_stderr=94.16327059776272) theilslopes = (0.0, 52.0, 0.0, 0.0) siegelslopes= (0.0, 52.0)
Current result:
linregress = LinregressResult(slope=-0.08117408906882585, intercept=212.77543859649109, rvalue=-0.14521616256311687, pvalue=0.3777456213641338, stderr=0.09092294431311998, intercept_stderr=182.21245386044583) theilslopes = (5.5, -10970.0, 1.0909090909090908, 11.272727272727273) siegelslopes= (-0.027777777777777776, 107.36111111111111) linregress = LinregressResult(slope=0.7799595141700404, intercept=-1526.3721997300943, rvalue=0.648915022489458, pvalue=7.885128179731413e-06, stderr=0.1503448757858782, intercept_stderr=301.2958824556652) theilslopes = (1.6666666666666667, -3303.0, 1.2857142857142858, 2.1333333333333333) siegelslopes= (0.04999999999999999, -62.39999999999998) linregress = LinregressResult(slope=-1.130971659919028, intercept=2291.15951417004, rvalue=-0.7989778176023127, pvalue=1.0820717823130094e-09, stderr=0.13994295315037716, intercept_stderr=280.4501007599699) theilslopes = (11.333333333333334, -22680.0, 8.73076923076923, 14.125) siegelslopes= (-0.1539473684210526, 339.12499999999994) linregress = LinregressResult(slope=0.02186234817813765, intercept=7.469905533063432, rvalue=0.07626971562528158, pvalue=0.6444538083463693, stderr=0.04698691899214995, intercept_stderr=94.16327059776272) theilslopes = (0.3333333333333333, -616.0, 0.07142857142857142, 0.625) siegelslopes= (0.0, 52.0)
Reproducing Code Example
Error message
SciPy/NumPy/Python version and system information
The text was updated successfully, but these errors were encountered: