You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "TPDeramus (via GitHub)" <gi...@apache.org> on 2023/11/16 18:51:45 UTC
Re: [I] [Python] Pyarrow Group_by ChunkedArray and most frequent value [arrow]
TPDeramus commented on issue #38747:
URL: https://github.com/apache/arrow/issues/38747#issuecomment-1815040712
Managed to solve issue 1., though probably not as elegantly as I could have, by using the following to generate a list of lists with the summary variable(s):
```
grenerator = [([x for x in table.schema.names if "c" in x][i], "mean") for i in range(len([x for x in table.schema.names if "c" in x]))]
table.group_by("IDs").aggregate(grenerator)
```
The second part however, still eludes me.
Would I be better off filtering by ID and then running the `mode` call individually and appending?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org