Skip to content

Commit 8b8806e

Browse files
authored
REFACTOR-#7315: Refactor axis checks in squeeze (#7400)
Signed-off-by: Jonathan Shi <[email protected]>
1 parent 7867400 commit 8b8806e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modin/pandas/dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,12 +2074,12 @@ def squeeze(
20742074
Squeeze 1 dimensional axis objects into scalars.
20752075
"""
20762076
axis = self._get_axis_number(axis) if axis is not None else None
2077-
if axis is None and (len(self.columns) == 1 or len(self.index) == 1):
2077+
if axis is None and (len(self.columns) == 1 or len(self) == 1):
20782078
return Series(query_compiler=self._query_compiler).squeeze()
20792079
if axis == 1 and len(self.columns) == 1:
20802080
self._query_compiler._shape_hint = "column"
20812081
return Series(query_compiler=self._query_compiler)
2082-
if axis == 0 and len(self.index) == 1:
2082+
if axis == 0 and len(self) == 1:
20832083
qc = self.T._query_compiler
20842084
qc._shape_hint = "column"
20852085
return Series(query_compiler=qc)

0 commit comments

Comments
 (0)