Skip to content

Commit

Permalink
Replaced DataFrame.applymap() that is now deprecated with DataFrame.m…
Browse files Browse the repository at this point in the history
…ap() (#414)

Signed-off-by: S.J. Guillot <58807831+sjg2203@users.noreply.github.com>
  • Loading branch information
sjg2203 authored Apr 7, 2024
1 parent 77cbd57 commit e74eaa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pingouin/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/pingouin/pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit e74eaa3

Please sign in to comment.