Skip to content

Commit

Permalink
FEAT-modin-project#2663: Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: William Ma <[email protected]>

Signed-off-by: Devin Petersohn <[email protected]>
  • Loading branch information
devin-petersohn committed Jan 31, 2021
1 parent 06c81ea commit 2a5c708
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modin/engines/base/frame/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ def from_labels(self):
Returns
-------
BasePandasFrame
A new BasePandasFrame
A new BasePandasFrame.
"""
new_row_labels = pandas.RangeIndex(len(self.index))
# Column labels are different for multilevel index
# Column labels are different for multilevel index.
if len(self.index.names) > 1:
# We will also use the `new_column_names` in the calculation of the internal metadata, so this is a
# lightweight way of ensuring the metadata matches.
Expand Down Expand Up @@ -583,13 +583,13 @@ def from_labels_executor(df, **kwargs):
[0],
keep_remaining=True,
)
new_column_widths = [len(self.index.names) + self._column_widths[0]] + self._column_widths[1:]
result = self.__constructor__(
new_parts,
new_row_labels,
new_columns,
row_lengths=self._row_lengths_cache,
column_widths=[len(self.index.names) + self._column_widths[0]]
+ self._column_widths[1:],
column_widths=new_column_widths,
)
# Propagate the new row labels to the all dataframe partitions
result._apply_index_objs(0)
Expand Down

0 comments on commit 2a5c708

Please sign in to comment.