Skip to content

Commit

Permalink
test_iter passing
Browse files Browse the repository at this point in the history
  • Loading branch information
arunjose696 committed May 16, 2024
1 parent 75fd761 commit 571bf32
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,17 @@ def has_multiindex(self, axis=0):
assert axis == 1
return isinstance(self._pandas_frame.columns, pandas.MultiIndex)

def isin(self, values, ignore_indices=False, **kwargs):
if isinstance(values, type(self)) and ignore_indices:
# Pandas logic is that it ignores indexing if 'values' is a 1D object
values = values.to_pandas().squeeze(axis=1)
if self._shape_hint == "column":
return _register_default_pandas(pandas.Series.isin, is_series=True)(self, values, **kwargs)
else:
return _register_default_pandas(pandas.DataFrame.isin)(
self, values, **kwargs
)

def to_pandas(self):
return self._pandas_frame

Expand Down Expand Up @@ -1297,14 +1308,6 @@ def getitem_column_array(self, key, numeric=False):
return self.__constructor__(self._pandas_frame.iloc[:, key])
return self.__constructor__(self._pandas_frame.loc[:, key])

def columnarize(self):
if len(self._pandas_frame.columns) != 1 or (
len(self._pandas_frame.index) == 1
and self._pandas_frame.index[0] == MODIN_UNNAMED_SERIES_LABEL
):
return SmallQueryCompiler(self._pandas_frame.transpose())
return self

def is_series_like(self):
return (
len(self._pandas_frame.columns) == 1 or len(self._pandas_frame.index) == 1
Expand Down

0 comments on commit 571bf32

Please sign in to comment.