-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Groupby object does not implement len() method.
To Reproduce
To help us to reproduce this bug, please provide information below:
- Your Python version
- The version of Xorbits you use
- Versions of crucial packages, such as numpy, scipy and pandas
- Full stack of the error.
- Minimized code to reproduce the error.
In [1]: import xorbits.pandas as pd
In [2]: df = pd.DataFrame({'a': ['a', 'b', 'a', 'c'], 'b': [0.1, 0.2, 0.3, 0.4], 'c': ['aa', 'bb', 'cc', 'aa']})
In [3]: grouped = df.groupby('b')
In [4]: len(grouped)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 len(grouped)
File ~/Workspace/xorbits/python/xorbits/core/data.py:267, in DataRef.__len__(self)
263 raise TypeError(
264 f"object with shape {self.data._mars_entity.shape} has no len()"
265 )
266 else:
--> 267 raise TypeError(f"object of type '{self.data.data_type}' has no len()")
TypeError: object of type 'DataType.dataframe_groupby' has no len()
Expected behavior
__len__()
implementd.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working