Skip to content

Commit

Permalink
(update) Use map instead of applymap as it's deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lou-k committed Feb 21, 2024
1 parent ead74de commit 74ea49b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hashable_df/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def f(value):

def hashable_df(df):
"""Return a DataFrame with hashable cell values."""
# applymap might change types. Try to restore the original.
# map might change types. Try to restore the original.
orig_types = df.dtypes
df = df.applymap(f).astype(orig_types, errors="ignore")
df = df.map(f).astype(orig_types, errors="ignore")
return df


Expand Down

0 comments on commit 74ea49b

Please sign in to comment.