Skip to content

Commit

Permalink
Deindent
Browse files Browse the repository at this point in the history
  • Loading branch information
isVoid committed Mar 8, 2022
1 parent 9959a6c commit f4349bd
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,23 +1312,21 @@ def _slice(self: T, arg: slice) -> T:
start, stop=stop, step=stride, dtype=np.int32
)
)
else:
columns_to_slice = [
*(self._index._data.columns if not is_range_index else []),
*self._columns,
]
result = self._from_columns_like_self(
libcudf.copying.columns_slice(columns_to_slice, [start, stop])[
0
],
self._column_names,
None if is_range_index else self._index.names,
)

if is_range_index:
result.index = self.index[start:stop]
result._set_column_names_like(self)
return result
columns_to_slice = [
*(self._index._data.columns if not is_range_index else []),
*self._columns,
]
result = self._from_columns_like_self(
libcudf.copying.columns_slice(columns_to_slice, [start, stop])[0],
self._column_names,
None if is_range_index else self._index.names,
)

if is_range_index:
result.index = self.index[start:stop]
result._set_column_names_like(self)
return result

@annotate("DATAFRAME_MEMORY_USAGE", color="blue", domain="cudf_python")
def memory_usage(self, index=True, deep=False):
Expand Down

0 comments on commit f4349bd

Please sign in to comment.