Skip to content

Commit

Permalink
PERF-#6723: Use '_shape_hint = column' in 'DataFrame.squeeze'
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Nov 7, 2023
1 parent bb94bbe commit 5548c73
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,7 @@ def squeeze(self, axis=None): # noqa: PR01, RT01, D200
if axis is None and (len(self.columns) == 1 or len(self.index) == 1):
return Series(query_compiler=self._query_compiler).squeeze()
if axis == 1 and len(self.columns) == 1:
self._query_compiler._shape_hint = "column"
return Series(query_compiler=self._query_compiler)
if axis == 0 and len(self.index) == 1:
return Series(query_compiler=self.T._query_compiler)
Expand Down

0 comments on commit 5548c73

Please sign in to comment.