[
https://issues.apache.org/jira/browse/ARROW-14608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17622856#comment-17622856
]
Jacek Pliszka edited comment on ARROW-14608 at 10/23/22 6:19 PM:
-----------------------------------------------------------------
I think it should be relatively easy to do something like this:
{code:python}
t.group_by(['keys', 'values']).aggregate()
{code}
I did some naive benchmarks and looks like it should be 30% faster than
converting to pandas and deduplicating. This was my naive test:
{code:python}
t.append_column('i', pa.array([1]*len(t),pa.int64())).group_by(['keys',
'values']).aggregate([("i", "max")]).drop(['i_max'])
{code}
And on small 5M table it took 245ms while 359ms for
t.to_pandas().drop_duplicates()
Actual aggregation without adding dummy column should be even faster still
will allow drop_duplicates functionality until better implementation arrives
was (Author: jacek.pliszka):
I think it should be relatively easy to do something like this:
{code:python}
t.group_by(['keys', 'values']).aggregate()
{code}
I did some naive benchmarks and looks like it should be 30% faster than
converting to pandas and deduplicating. This was my naive test:
{code:python}
t.append_column('i', pa.array([1]*len(t),pa.int64())).group_by(['keys',
'values']).aggregate([("i", "max")]).drop(['i_max'])
{code}
actual aggregation without i should be even faster still will allow
drop_duplicates functionality until better implementation arrives
> [Python] Provide access to hash_aggregate functions through a group_by method
> -----------------------------------------------------------------------------
>
> Key: ARROW-14608
> URL: https://issues.apache.org/jira/browse/ARROW-14608
> Project: Apache Arrow
> Issue Type: Sub-task
> Components: Python
> Affects Versions: 6.0.0
> Reporter: Alessandro Molina
> Assignee: Alessandro Molina
> Priority: Major
> Labels: pull-request-available
> Fix For: 7.0.0
>
> Time Spent: 10h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)