Skip to content

Commit

Permalink
Don't reindex an input dataframe on setitem if the original dataframe…
Browse files Browse the repository at this point in the history
… was empty.
  • Loading branch information
vyasr committed Apr 22, 2021
1 parent cdf7704 commit 9909706
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):
if not input_df.index.equals(replace_df.index) and len(input_df) != 0:
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 9909706

Please sign in to comment.