diff --git a/pycytominer/cyto_utils/cells.py b/pycytominer/cyto_utils/cells.py index debb209d..7fd8a7e4 100644 --- a/pycytominer/cyto_utils/cells.py +++ b/pycytominer/cyto_utils/cells.py @@ -713,8 +713,13 @@ def merge_single_cells( sc_df = ( self.image_df.merge(sc_df, on=self.merge_cols, how="right") - .rename(self.linking_col_rename, axis="columns") - .rename(self.full_merge_suffix_rename, axis="columns") + # pandas rename performance may be improved using copy=False, inplace=False + # reference: https://ryanlstevens.github.io/2022-05-06-pandasColumnRenaming/ + .rename( + self.linking_col_rename, axis="columns", copy=False, inplace=False + ).rename( + self.full_merge_suffix_rename, axis="columns", copy=False, inplace=False + ) ) if single_cell_normalize: # Infering features is tricky with non-canonical data