3 ms·
I want a similar toolkit that lifts over the Ruby/Groovy/Kotlin style functions like countBy, groupBy, sortBy, collate, etc etc. Programming in Python is such a
by zmmmmm 5y ago
I want a similar toolkit that lifts over the Ruby/Groovy/Kotlin style functions like countBy, groupBy, sortBy, collate, etc etc. Programming in Python is such a chore without these higher level collections APIs and for some reason (I guess, list comprehensions being considered idiomatic, bare bones itertools being considered "good enough", and the lack of real inline closures?) it doesn't seem like they'll ever be part of Python proper. But I still want them.
- wswope 5y agoWith full acknowledgment that it would be better to have at least some of those in the stdlib, Pandas covers all those needs pretty well in practice, with the bonus of workarounds that sidestep CPython’s usual performance limitations.
- lauriat 5y agoThere is https://github.com/lauriat/funct https://github.com/lauriat/funct which has some of those higher level functions.
- 41b696ef1113 5y agoMaybe the toolz[0] family would cover your use cases? There is also a Cython implementation if you need better performance. [0] https://github.com/pytoolz/toolz/ https://github.com/pytoolz/toolz/
- Daishiman 5y agoThe `collections`, `itertools` and `functools` packages have most of these.