From f4349bdaf828037c31420f61bcffee7ce1da2485 Mon Sep 17 00:00:00 2001 From: Michael Wang Date: Tue, 8 Mar 2022 11:56:02 -0800 Subject: [PATCH] Deindent --- python/cudf/cudf/core/dataframe.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index d74aeddbda7..e687c274d2f 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -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):