diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 492152e5151..30b6c307fbd 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -7953,7 +7953,7 @@ def _setitem_with_dataframe( "Number of Input Columns must be same replacement Dataframe" ) - if not input_df.index.equals(replace_df.index) and len(input_df) != 0: + if len(input_df) != 0 and not input_df.index.equals(replace_df.index): replace_df = replace_df.reindex(input_df.index) for col_1, col_2 in zip(input_cols, replace_df.columns):