From e74eaa3846951bd2013a627bbf3101a50812b00e Mon Sep 17 00:00:00 2001 From: "S.J. Guillot" <58807831+sjg2203@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:04:52 +0200 Subject: [PATCH] Replaced DataFrame.applymap() that is now deprecated with DataFrame.map() (#414) Signed-off-by: S.J. Guillot <58807831+sjg2203@users.noreply.github.com> --- src/pingouin/correlation.py | 4 ++-- src/pingouin/pairwise.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pingouin/correlation.py b/src/pingouin/correlation.py index 24e365f9..8edc964f 100644 --- a/src/pingouin/correlation.py +++ b/src/pingouin/correlation.py @@ -1113,9 +1113,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)] diff --git a/src/pingouin/pairwise.py b/src/pingouin/pairwise.py index 5a189d8d..36deae48 100644 --- a/src/pingouin/pairwise.py +++ b/src/pingouin/pairwise.py @@ -758,9 +758,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)]