Skip to content

Commit

Permalink
Avoid external API
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Dec 11, 2023
1 parent 125e0d4 commit 2258a73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,9 @@ def reindex(
df = self
else:
columns = as_index(columns)
intersection = self.columns.intersection(columns.to_pandas())
intersection = self._data.to_pandas_index().intersection(
columns.to_pandas()
)
df = self.loc[:, intersection]

return df._reindex(
Expand Down
2 changes: 2 additions & 0 deletions python/cudf/cudf/core/indexed_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,8 @@ def _reindex(
else:
multiindex = False
names = column_names
if isinstance(names, cudf.Index):
names = names.to_pandas()
rangeindex = isinstance(
column_names, (pd.RangeIndex, cudf.RangeIndex)
)
Expand Down

0 comments on commit 2258a73

Please sign in to comment.