Skip to content

Commit

Permalink
Address PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Sep 21, 2021
1 parent 1095d7d commit be05fa1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/cudf/cudf/core/multiindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,18 @@ def __init__(
)

source_data = {}
for i, (cname, col) in enumerate(codes._data.items()):
for i, (column_name, col) in enumerate(codes._data.items()):
if -1 in col.values:
level = cudf.DataFrame(
{cname: [None] + list(levels[i])},
{column_name: [None] + list(levels[i])},
index=range(-1, len(levels[i])),
)
else:
level = cudf.DataFrame({cname: levels[i]})
level = cudf.DataFrame({column_name: levels[i]})

source_data[cname] = libcudf.copying.gather(level, col)[0][cname]
source_data[column_name] = libcudf.copying.gather(level, col)[0][
column_name
]

super().__init__(source_data)
self._levels = levels
Expand Down

0 comments on commit be05fa1

Please sign in to comment.