From 212e59568e72e4ea6275b38031f4f766bf3d70d0 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Tue, 16 Jul 2024 02:57:57 -0700 Subject: [PATCH] Call DataFrame.map instead of DataFrame.applymap (#55) --- pytorch_memlab/line_profiler/line_records.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_memlab/line_profiler/line_records.py b/pytorch_memlab/line_profiler/line_records.py index 8e20d6d..1f4173e 100644 --- a/pytorch_memlab/line_profiler/line_records.py +++ b/pytorch_memlab/line_profiler/line_records.py @@ -181,7 +181,7 @@ def __repr__(self): for qual_name, merged in self._merge_line_records_with_code().items(): maxlen = max(len(c) for c in merged.code) left_align = '{{:{maxlen}s}}'.format(maxlen=maxlen) - merged[byte_cols] = merged[byte_cols].applymap(readable_size) + merged[byte_cols] = merged[byte_cols].map(readable_size) # This is a mess, but I can't find any other way to left-align text strings. code_header = (left_align.format('code'), '', '')