-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced DataFrame.applymap() that is now deprecated with DataFrame.m…
…ap() Updated code to Black formatting Signed-off-by: S.J. Guillot <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
# Author: Raphael Vallat <[email protected]> | ||
import warnings | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import pandas_flavor as pf | ||
from scipy.spatial.distance import pdist, squareform | ||
from scipy.stats import pearsonr, spearmanr, kendalltau | ||
|
||
from pingouin.bayesian import bayesfactor_pearson | ||
from pingouin.config import options | ||
from pingouin.power import power_corr | ||
from pingouin.multicomp import multicomp | ||
from pingouin.effsize import compute_esci | ||
from pingouin.utils import remove_na, _perm_pval, _postprocess_dataframe | ||
from pingouin.bayesian import bayesfactor_pearson | ||
|
||
from pingouin.multicomp import multicomp | ||
from pingouin.power import power_corr | ||
from pingouin.utils import _perm_pval,_postprocess_dataframe,remove_na | ||
from scipy.spatial.distance import pdist,squareform | ||
from scipy.stats import kendalltau,pearsonr,spearmanr | ||
|
||
__all__ = ["corr", "partial_corr", "pcorr", "rcorr", "rm_corr", "distance_corr"] | ||
|
||
|
@@ -1113,9 +1112,9 @@ def replace_pval(x): | |
|
||
if stars: | ||
# Replace p-values by stars | ||
mat_upper = mat_upper.applymap(replace_pval) | ||
mat_upper=mat_upper.map(replace_pval) | ||
else: | ||
mat_upper = mat_upper.applymap(lambda x: ffp(x, precision=decimals)) | ||
mat_upper=mat_upper.map(lambda x:ffp(x,precision=decimals)) | ||
|
||
# Replace upper triangle by p-values or n | ||
mat.to_numpy()[tif(mat, k=1)] = mat_upper.to_numpy()[tif(mat, k=1)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
# Author: Raphael Vallat <[email protected]> | ||
# Date: April 2018 | ||
import warnings | ||
from itertools import combinations,product | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import pandas_flavor as pf | ||
from itertools import combinations, product | ||
from pingouin.config import options | ||
from pingouin.parametric import anova | ||
from pingouin.multicomp import multicomp | ||
from pingouin.effsize import compute_effsize | ||
from pingouin.utils import _check_dataframe, _flatten_list, _postprocess_dataframe | ||
from pingouin.multicomp import multicomp | ||
from pingouin.parametric import anova | ||
from pingouin.utils import _check_dataframe,_flatten_list,_postprocess_dataframe | ||
from scipy.stats import studentized_range | ||
import warnings | ||
|
||
__all__ = [ | ||
"pairwise_ttests", | ||
|
@@ -758,9 +759,9 @@ def replace_pval(x): | |
|
||
if stars: | ||
# Replace p-values by stars | ||
mat_upper = mat_upper.applymap(replace_pval) | ||
mat_upper=mat_upper.map(replace_pval) | ||
else: | ||
mat_upper = mat_upper.applymap(lambda x: ffp(x, precision=decimals)) | ||
mat_upper=mat_upper.map(lambda x:ffp(x,precision=decimals)) | ||
|
||
# Replace upper triangle by p-values | ||
mat.to_numpy()[tif(mat, k=1)] = mat_upper.to_numpy()[tif(mat, k=1)] | ||
|