Skip to content

Commit

Permalink
Suppress DataFrame.applymap deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mravi committed Dec 24, 2024
1 parent 7c86bf3 commit bdc8393
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ def _display_dataframe(self, data, update=None):
format_window_info_in_dataframe(data)
# Convert the dataframe into rows, each row looks like
# [column_1_val, column_2_val, ...].
rows = data.applymap(lambda x: str(x)).to_dict('split')['data']
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore", message=".*DataFrame.applymap has been deprecated.*")
rows = data.applymap(lambda x: str(x)).to_dict('split')['data']

# Convert each row into dict where keys are column index in the datatable
# to be rendered and values are data from the dataframe. Column index 0 is
# left out to hold the int index (not part of the data) from dataframe.
Expand Down

0 comments on commit bdc8393

Please sign in to comment.