AutoStatLib 0.1.7__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of AutoStatLib might be problematic. Click here for more details.
- AutoStatLib/AutoStatLib.py +21 -17
- AutoStatLib/__init__.py +2 -2
- AutoStatLib/__main__.py +3 -3
- AutoStatLib/_version.py +1 -1
- {AutoStatLib-0.1.7.dist-info → AutoStatLib-0.2.0.dist-info}/METADATA +1 -1
- AutoStatLib-0.2.0.dist-info/RECORD +9 -0
- AutoStatLib-0.1.7.dist-info/RECORD +0 -9
- {AutoStatLib-0.1.7.dist-info → AutoStatLib-0.2.0.dist-info}/LICENSE +0 -0
- {AutoStatLib-0.1.7.dist-info → AutoStatLib-0.2.0.dist-info}/WHEEL +0 -0
- {AutoStatLib-0.1.7.dist-info → AutoStatLib-0.2.0.dist-info}/top_level.txt +0 -0
AutoStatLib/AutoStatLib.py
CHANGED
|
@@ -96,14 +96,14 @@ class __StatisticalTests():
|
|
|
96
96
|
self.popmean = 0
|
|
97
97
|
self.AddWarning('no_pop_mean_set')
|
|
98
98
|
data = [i - self.popmean for i in self.data[0]]
|
|
99
|
-
w_stat,
|
|
99
|
+
w_stat, p_value = wilcoxon(data)
|
|
100
100
|
if self.tails == 1:
|
|
101
101
|
p_value /= 2
|
|
102
102
|
self.test_name = 'Wilcoxon signed-rank test for single sample'
|
|
103
103
|
self.test_id = 'wilcoxon_single_sample'
|
|
104
104
|
self.paired = False
|
|
105
105
|
self.test_stat = w_stat
|
|
106
|
-
self.p_value =
|
|
106
|
+
self.p_value = p_value
|
|
107
107
|
|
|
108
108
|
def wilcoxon(self):
|
|
109
109
|
stat, p_value = wilcoxon(self.data[0], self.data[1])
|
|
@@ -148,20 +148,22 @@ class __NormalityTests():
|
|
|
148
148
|
lf = False
|
|
149
149
|
|
|
150
150
|
# Anderson-Darling test
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
if n >= 20:
|
|
152
|
+
ad_stat, ad_p_value = self.anderson_get_p(
|
|
153
|
+
data, dist='norm')
|
|
154
|
+
if ad_p_value > 0.05:
|
|
155
|
+
ad = True
|
|
156
|
+
else:
|
|
157
|
+
ad = False
|
|
157
158
|
|
|
158
159
|
# D'Agostino-Pearson test
|
|
159
|
-
ap_stat, ap_p_value = normaltest(data)
|
|
160
160
|
# test result is skewed if n<20
|
|
161
|
-
if
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
if n >= 20:
|
|
162
|
+
ap_stat, ap_p_value = normaltest(data)
|
|
163
|
+
if ap_p_value > 0.05:
|
|
164
|
+
ap = True
|
|
165
|
+
else:
|
|
166
|
+
ap = False
|
|
165
167
|
|
|
166
168
|
# print(ap_p_value, ad_p_value, sw_p_value, lf_p_value)
|
|
167
169
|
|
|
@@ -386,7 +388,7 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
|
|
|
386
388
|
'wilcoxon_single_sample',
|
|
387
389
|
]
|
|
388
390
|
self.warning_ids_all = {
|
|
389
|
-
'not-numeric': '\nWarning: Non-numeric data was found in input and ignored.\n Make sure the input data is correct to get the correct results\n',
|
|
391
|
+
# 'not-numeric': '\nWarning: Non-numeric data was found in input and ignored.\n Make sure the input data is correct to get the correct results\n',
|
|
390
392
|
'param_test_with_non-normal_data': '\nWarning: Parametric test was manualy chosen for Not-Normaly distributed data.\n The results might be skewed. \n Please, run non-parametric test or preform automatic test selection.\n',
|
|
391
393
|
'non-param_test_with_normal_data': '\nWarning: Non-Parametric test was manualy chosen for Normaly distributed data.\n The results might be skewed. \n Please, run parametric test or preform automatic test selection.\n',
|
|
392
394
|
'no_pop_mean_set': '\nWarning: No Population Mean was set up for single-sample test, used default 0 value.\n The results might be skewed. \n Please, set the Population Mean and run the test again.\n',
|
|
@@ -411,7 +413,8 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
|
|
|
411
413
|
# adjusting input data type
|
|
412
414
|
self.data = self.floatify_recursive(self.groups_list)
|
|
413
415
|
if self.warning_flag_non_numeric_data:
|
|
414
|
-
self.
|
|
416
|
+
self.log(
|
|
417
|
+
'Text or other non-numeric data in the input was ignored:')
|
|
415
418
|
|
|
416
419
|
# delete the empty cols from input
|
|
417
420
|
self.data = [col for col in self.data if any(
|
|
@@ -419,13 +422,14 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
|
|
|
419
422
|
|
|
420
423
|
# User input assertion block
|
|
421
424
|
try:
|
|
425
|
+
assert self.data, 'There is no input data'
|
|
422
426
|
assert self.tails in [1, 2], 'Tails parameter can be 1 or 2 only'
|
|
423
427
|
assert test in self.test_ids_all or test == 'auto', 'Wrong test id choosen, ensure you called correct function'
|
|
424
428
|
assert not (self.n_groups > 1
|
|
425
429
|
and (test == 't_test_single_sample'
|
|
426
430
|
or test == 'wilcoxon_single_sample')), 'Only one group of data must be given for single-group tests'
|
|
427
431
|
assert all(len(
|
|
428
|
-
group)
|
|
432
|
+
group) >= 4 for group in self.data), 'Each group must contain at least four values'
|
|
429
433
|
assert not (self.paired == True and not all(len(lst) == len(
|
|
430
434
|
self.data[0]) for lst in self.data)), 'Paired groups must be the same length'
|
|
431
435
|
assert not (test == 'friedman' and not all(len(lst) == len(
|
|
@@ -604,4 +608,4 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
|
|
|
604
608
|
|
|
605
609
|
|
|
606
610
|
if __name__ == '__main__':
|
|
607
|
-
print('
|
|
611
|
+
print('This package works as an imported module only.\nUse "import autostatlib" statement')
|
AutoStatLib/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
from .AutoStatLib import StatisticalAnalysis
|
|
2
|
-
from ._version import __version__
|
|
1
|
+
from AutoStatLib.AutoStatLib import StatisticalAnalysis
|
|
2
|
+
from AutoStatLib._version import __version__
|
AutoStatLib/__main__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
from .AutoStatLib import StatisticalAnalysis
|
|
3
|
-
from ._version import __version__
|
|
2
|
+
from AutoStatLib.AutoStatLib import StatisticalAnalysis
|
|
3
|
+
from AutoStatLib._version import __version__
|
|
4
4
|
|
|
5
5
|
if __name__ == '__main__':
|
|
6
|
-
print('
|
|
6
|
+
print('This package works as an imported module only.\nUse "import autostatlib" statement')
|
AutoStatLib/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# AutoStatLib package version:
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.2.0"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
AutoStatLib/AutoStatLib.py,sha256=fSDVReNCcidK7PmKN5r3pUcu-5ZHxf5nVlWiIi44Moo,22414
|
|
2
|
+
AutoStatLib/__init__.py,sha256=0wHYnglzKRPqSHtZlfbMEA2Bj5rDR4LLaXbOrJi-sqM,101
|
|
3
|
+
AutoStatLib/__main__.py,sha256=ROKWensrxDh3Gl-yhexJ-BYFohDSh9y-CuMkaLpmnnQ,247
|
|
4
|
+
AutoStatLib/_version.py,sha256=3NP9JpFOaSsAhLIlSo_w7f117z3XyFjM1ZwmEoVUPl0,53
|
|
5
|
+
AutoStatLib-0.2.0.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
6
|
+
AutoStatLib-0.2.0.dist-info/METADATA,sha256=h7sUItDh2vtQTdjubf9rfMWL5mQazlkSy3gHIold3Ts,35547
|
|
7
|
+
AutoStatLib-0.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
+
AutoStatLib-0.2.0.dist-info/top_level.txt,sha256=BuHzVyE2andc7RwD_UPmDjLl9CUAyBH6WHZGjaIReUI,12
|
|
9
|
+
AutoStatLib-0.2.0.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
AutoStatLib/AutoStatLib.py,sha256=2yJ2lgzTHcH9GukBmq4htcE2ZZ4rB7PjsQqoGepzOfM,22275
|
|
2
|
-
AutoStatLib/__init__.py,sha256=m5_lTjJGJzwPqM1D72D90dbvSOY1EWuNE8VfFRagx1s,79
|
|
3
|
-
AutoStatLib/__main__.py,sha256=LaA_aF8KkLy7zF3JyNPPGkK1nrM9hLJEtqGv27xvzmg,192
|
|
4
|
-
AutoStatLib/_version.py,sha256=vt-T6UPFgo5_4i5AEliVI-mg9Ki4a7jH_gjNPD1BfuM,53
|
|
5
|
-
AutoStatLib-0.1.7.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
6
|
-
AutoStatLib-0.1.7.dist-info/METADATA,sha256=RSrFPlYSu1x0iyvt45jQUksIetonXXrEnNIH5fcNxzg,35547
|
|
7
|
-
AutoStatLib-0.1.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
-
AutoStatLib-0.1.7.dist-info/top_level.txt,sha256=BuHzVyE2andc7RwD_UPmDjLl9CUAyBH6WHZGjaIReUI,12
|
|
9
|
-
AutoStatLib-0.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|