Skip to content

Commit

Permalink
Update numpy-tooltip-images.rst
Browse files Browse the repository at this point in the history
FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
  • Loading branch information
mattijn authored Oct 20, 2023
1 parent cf76f03 commit d65b2da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/case_studies/numpy-tooltip-images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ in order to have a quantitative measurement to plot.
'group': rng.choice(['a', 'b', 'c'], size=n_rows)
})
# Compute the area as the proportion of pixels above a threshold
df[['image1_area', 'image2_area']] = df[['image1', 'image2']].applymap(lambda x: (x > 0.4).mean())
df[['image1_area', 'image2_area']] = df[['image1', 'image2']].map(lambda x: (x > 0.4).mean())
df

Next, we define the function
Expand Down

0 comments on commit d65b2da

Please sign in to comment.