Skip to content

Commit

Permalink
Merge pull request #319 from kayjan/bugfix/tree-diff-substring
Browse files Browse the repository at this point in the history
Use iloc instead of df._append
  • Loading branch information
kayjan authored Nov 3, 2024
2 parents ffb365f + 82d5a6b commit 4e85c7a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bigtree/tree/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,10 @@ def add_suffix_to_path(
Returns:
(pd.DataFrame)
"""
data_replace = _data[_condition]
data_replace[path_col] = data_replace[path_col].str.replace(
_original_name, f"{_original_name} ({suffix})", regex=True
)
data_not_replace = _data[~_condition]
return data_replace._append(data_not_replace).sort_index()
_data.iloc[_condition.values, _data.columns.get_loc(path_col)] = _data.iloc[
_condition.values, _data.columns.get_loc(path_col)
].str.replace(_original_name, f"{_original_name} ({suffix})", regex=True)
return _data

for node_removed, move_indicator in zip(nodes_removed, moved_from_indicator):
if not detail:
Expand Down

0 comments on commit 4e85c7a

Please sign in to comment.