Skip to content

Commit

Permalink
updated deprecated syntax to support pandas 2.0 (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-j-cai authored Apr 5, 2023
1 parent 471af33 commit 75effda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions smdebug/profiler/analysis/utils/pandas_data_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _get_utilization_phase_by_time_interval(self, interval_df):

def helper(start, end, phase):
self.sys_metrics_df.loc[
(self.sys_metrics_df["timestamp_us"].between(start, end, inclusive=True)), "phase"
(self.sys_metrics_df["timestamp_us"].between(start, end)), "phase"
] = phase

interval_df.apply(
Expand Down Expand Up @@ -357,7 +357,7 @@ def helper(x, util_ranges):
return device_sys_df

usage_stats = device_sys_df[
device_sys_df["type"].str.contains("|".join(resources)).any(level=0)
device_sys_df["type"].str.contains("|".join(resources)).groupby(level=0).any()
]

df_grouped = (
Expand Down
4 changes: 2 additions & 2 deletions smdebug/profiler/analysis/utils/profiler_data_to_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,15 @@ def get_profiler_data_by_step(self, start_step, end_step, cache_metrics=False):
)

fw_metrics_df = fw_metrics_df[
(fw_metrics_df["step"].between(start_step, end_step, inclusive=True))
(fw_metrics_df["step"].between(start_step, end_step))
]
start_time, end_time = (
fw_metrics_df["start_time_us"].min(),
fw_metrics_df["end_time_us"].max(),
)

sys_metrics_df = sys_metrics_df[
(sys_metrics_df["timestamp_us"].between(start_time, end_time, inclusive=True))
(sys_metrics_df["timestamp_us"].between(start_time, end_time))
]

return sys_metrics_df, fw_metrics_df
Expand Down

0 comments on commit 75effda

Please sign in to comment.