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

Avoid groupby.agg(callable) in groupby-var #4482

Merged
merged 1 commit into from Feb 14, 2019

Conversation

Projects
None yet
3 participants
@mrocklin
Copy link
Member

commented Feb 14, 2019

This has two benefits

  1. It's much faster the following benchmark shows a 5x improvement
  2. It doesn't require the pandas-like container to implement
    groupby.agg(callable), which helps cudf

Benchmark

I get five-ish seconds for this on master
And less than one second on this branch

from time import time
import dask
df = dask.datasets.timeseries(dtypes={'id': int, 'data': float}).persist()

start = time()
for i in range(3):
    df.groupby('id').data.std().compute()
stop = time()

print(stop - start)`
  • Tests added / passed
  • Passes flake8 dask

cc @thomcom @TomAugspurger

@mrocklin

This comment has been minimized.

Copy link
Member Author

commented Feb 14, 2019

@jangorecki this may affect your benchmarks

Avoid groupby.agg(callable) in groupby-var
This has two benefits

1.  It's much faster the following benchmark shows a 5x improvement
2.  It doesn't require the pandas-like container to implement
    groupby.agg(callable), which helps cudf

Benchmark
---------

I get five-ish seconds for this on master
And less than one second on this branch

```
from time import time
import dask
df = dask.datasets.timeseries(dtypes={'id': int, 'data': float}).persist()

start = time()
for i in range(3):
    df.groupby('id').data.std().compute()
stop = time()

print(stop - start)`
```

@mrocklin mrocklin force-pushed the mrocklin:dataframe-groupby-accel branch from 27e911c to 095793f Feb 14, 2019

@mrocklin mrocklin merged commit af231de into dask:master Feb 14, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mrocklin mrocklin deleted the mrocklin:dataframe-groupby-accel branch Feb 14, 2019

@thomcom

This comment has been minimized.

Copy link

commented Feb 14, 2019

Nice!

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

Avoid groupby.agg(callable) in groupby-var (dask#4482)
This has two benefits

1.  It's much faster the following benchmark shows a 5x improvement
2.  It doesn't require the pandas-like container to implement
    groupby.agg(callable), which helps cudf

Benchmark
---------

I get five-ish seconds for this on master
And less than one second on this branch

```
from time import time
import dask
df = dask.datasets.timeseries(dtypes={'id': int, 'data': float}).persist()

start = time()
for i in range(3):
    df.groupby('id').data.std().compute()
stop = time()

print(stop - start)`
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.