Skip to content

Commit bf97ef5

Browse files
committed
fixed copying p_values array, updated docs
1 parent 7d154ac commit bf97ef5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scikit_posthocs/_plotting.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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
23

34
import numpy as np
4-
from matplotlib import colors
5+
from matplotlib import colors, pyplot
56
from matplotlib.axes import Axes
6-
from matplotlib.colorbar import ColorbarBase, Colorbar
7+
from matplotlib.colorbar import Colorbar, ColorbarBase
78
from matplotlib.colors import ListedColormap
8-
from matplotlib import pyplot
99
from pandas import DataFrame, Index, Series
1010
from seaborn import heatmap
1111

@@ -38,11 +38,11 @@ def sign_array(p_values: Union[List, np.ndarray, DataFrame], alpha: float = 0.05
3838
[ 0.00119517, 1. , 0.18672227],
3939
[ 0.00278329, 0.18672227, 1. ]])
4040
>>> 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]])
4444
"""
45-
sig_array = np.array(p_values, copy=True)
45+
sig_array = deepcopy(np.array(p_values))
4646
sig_array[sig_array == 0] = 1e-10
4747
sig_array[sig_array > alpha] = 0
4848
sig_array[(sig_array < alpha) & (sig_array > 0)] = 1

0 commit comments

Comments
 (0)