Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Groupby object does not implement len() method #442

Open
qianduoduo0904 opened this issue May 16, 2023 · 1 comment · May be fixed by #533
Open

BUG: Groupby object does not implement len() method #442

qianduoduo0904 opened this issue May 16, 2023 · 1 comment · May be fixed by #533
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qianduoduo0904
Copy link
Contributor

qianduoduo0904 commented May 16, 2023

Describe the bug

Groupby object does not implement len() method.

To Reproduce

To help us to reproduce this bug, please provide information below:

  1. Your Python version
  2. The version of Xorbits you use
  3. Versions of crucial packages, such as numpy, scipy and pandas
  4. Full stack of the error.
  5. 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.

@XprobeBot XprobeBot added the bug Something isn't working label May 16, 2023
@XprobeBot XprobeBot modified the milestones: v0.3.1, v0.3.2 May 16, 2023
@RayJi01
Copy link
Contributor

RayJi01 commented Jun 15, 2023

take

@RayJi01 RayJi01 linked a pull request Jun 16, 2023 that will close this issue
2 tasks
@XprobeBot XprobeBot modified the milestones: v0.3.2, v0.4.1 Jul 1, 2023
@XprobeBot XprobeBot modified the milestones: v0.4.1, v0.4.3 Jul 11, 2023
@XprobeBot XprobeBot modified the milestones: v0.4.3, v0.4.4, v0.4.5 Jul 20, 2023
@XprobeBot XprobeBot modified the milestones: v0.5.0, v0.5.1 Jul 28, 2023
@XprobeBot XprobeBot modified the milestones: v0.5.1, v0.5.2 Aug 14, 2023
@XprobeBot XprobeBot modified the milestones: v0.5.2, v0.6.0, v0.6.1 Sep 8, 2023
@XprobeBot XprobeBot modified the milestones: v0.6.1, v0.6.2, v0.6.3 Sep 15, 2023
@XprobeBot XprobeBot modified the milestones: v0.6.3, v0.7.0 Sep 25, 2023
@XprobeBot XprobeBot removed this from the v0.7.0 milestone Oct 23, 2023
@XprobeBot XprobeBot added this to the v0.7.1 milestone Oct 23, 2023
@XprobeBot XprobeBot modified the milestones: v0.7.1, v0.7.2 Nov 21, 2023
@XprobeBot XprobeBot modified the milestones: v0.7.2, v0.7.3 Jan 5, 2024
@XprobeBot XprobeBot modified the milestones: v0.7.3, v0.7.4 Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants