1 | import math |
||
2 | import numpy as np |
||
0 ignored issues
–
show
|
|||
3 | import scipy |
||
0 ignored issues
–
show
The import
scipy could not be resolved.
This can be caused by one of the following: 1. Missing DependenciesThis error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands. # .scrutinizer.yml
before_commands:
- sudo pip install abc # Python2
- sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use
the command for the correct version.
2. Missing __init__.py filesThis error could also result from missing ![]() |
|||
4 | |||
5 | def wilcoxon_rank_sum(d1, d2): |
||
6 | # TODO Check this function!!! |
||
0 ignored issues
–
show
|
|||
7 | N1, N2 = np.sum(d1[1, :]), np.sum(d2[1, :]) |
||
8 | ni1, ni2 = d1.shape[1], d2.shape[1] |
||
9 | i1 = i2 = 0 |
||
10 | R = 0 |
||
11 | rank = 0 |
||
12 | while i1 < ni1 and i2 < ni2: |
||
13 | if d1[0, i1] < d2[0, i2]: |
||
14 | R += (rank + (d1[1, i1] - 1) / 2) * d1[1, i1] |
||
15 | rank += d1[1, i1] |
||
16 | i1 += 1 |
||
17 | elif d1[0, i1] == d2[0, i2]: |
||
18 | br = d1[1, i1] + d2[1, i2] |
||
19 | R += (rank + (br - 1) / 2) * d1[1, i1] |
||
20 | rank += br |
||
21 | i1 += 1 |
||
22 | i2 += 1 |
||
23 | else: |
||
24 | rank += d2[1, i2] |
||
25 | i2 += 1 |
||
26 | if i1 < ni1: |
||
27 | s = np.sum(d1[1, i1:]) |
||
28 | R += (rank + (s - 1) / 2) * s |
||
29 | U = R - N1 * (N1 + 1) / 2 |
||
30 | m = N1 * N2 / 2 |
||
31 | var = m * (N1 + N2 + 1) / 6 |
||
32 | z = abs(U - m) / math.sqrt(var) |
||
33 | p = 2 * (1 - scipy.special.ndtr(z)) |
||
34 | return z, p |
||
35 | |||
36 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.