|
1 | | -from typing import Optional, Union, List, Tuple, Dict, Set |
| 1 | +from copy import deepcopy |
| 2 | +from typing import Dict, List, Optional, Set, Tuple, Union |
2 | 3 |
|
3 | 4 | import numpy as np |
4 | | -from matplotlib import colors |
| 5 | +from matplotlib import colors, pyplot |
5 | 6 | from matplotlib.axes import Axes |
6 | | -from matplotlib.colorbar import ColorbarBase, Colorbar |
| 7 | +from matplotlib.colorbar import Colorbar, ColorbarBase |
7 | 8 | from matplotlib.colors import ListedColormap |
8 | | -from matplotlib import pyplot |
9 | 9 | from pandas import DataFrame, Index, Series |
10 | 10 | from seaborn import heatmap |
11 | 11 |
|
@@ -38,11 +38,11 @@ def sign_array(p_values: Union[List, np.ndarray, DataFrame], alpha: float = 0.05 |
38 | 38 | [ 0.00119517, 1. , 0.18672227], |
39 | 39 | [ 0.00278329, 0.18672227, 1. ]]) |
40 | 40 | >>> ph.sign_array(p_values) |
41 | | - array([[1, 1, 1], |
42 | | - [1, 1, 0], |
43 | | - [1, 0, 1]]) |
| 41 | + array([[-1, 1, 1], |
| 42 | + [ 1, -1, 0], |
| 43 | + [ 1, 0, -1]]) |
44 | 44 | """ |
45 | | - sig_array = np.array(p_values, copy=True) |
| 45 | + sig_array = deepcopy(np.array(p_values)) |
46 | 46 | sig_array[sig_array == 0] = 1e-10 |
47 | 47 | sig_array[sig_array > alpha] = 0 |
48 | 48 | sig_array[(sig_array < alpha) & (sig_array > 0)] = 1 |
|
0 commit comments