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

High complexity for chained Pandas Query #23

Open
corriebar opened this issue Oct 26, 2022 · 0 comments
Open

High complexity for chained Pandas Query #23

corriebar opened this issue Oct 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@corriebar
Copy link

Describe the bug
I ran it on the following code of chained pandas methods:

    mean_distances = (dataframe
                         .groupby('group')['distance']
                         .mean()
                         .to_frame()
                         .reset_index()
                         .fillna(0)
                         .rename(columns={'distance': 'distance_mean'})
                         )

and was surprised to get a complexity of 11. While I wouldn't argue that this expression should have 0 complexity, 11 seems to high for me. I also wondered if panda query chaining also could be case similarly to Django ORM queries to get lower complexity.

Expected behavior
A lower complexity.

**Version

  • 0.0.11

Additional context
This might be related to #22

@corriebar corriebar added the bug Something isn't working label Oct 26, 2022
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

No branches or pull requests

1 participant