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

@mrocklin
Copy link
Member

@mrocklin mrocklin 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
Copy link
Member Author

@mrocklin mrocklin commented Feb 14, 2019

@jangorecki this may affect your benchmarks

Loading

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 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
Loading
@mrocklin mrocklin deleted the dataframe-groupby-accel branch Feb 14, 2019
@thomcom
Copy link
Contributor

@thomcom thomcom commented Feb 14, 2019

Nice!

Loading

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this issue May 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)`
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants