Skip to content

Commit

Permalink
Check if df is empty before trying equality check for speed
Browse files Browse the repository at this point in the history
Co-authored-by: GALI PREM SAGAR <[email protected]>
  • Loading branch information
vyasr and galipremsagar authored Apr 22, 2021
1 parent 9e7b7ca commit 8bee629
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8bee629

Please sign in to comment.