# Groupby for regular array

**URL:** https://discourse.julialang.org/t/groupby-for-regular-array/9877
**Category:** General Usage
**Created:** [March 22, 2018, 5:26am UTC](https://discourse.julialang.org/t/groupby-for-regular-array/9877 "2018-03-22T05:26:48Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [March 22, 2018, 6:04am UTC](https://discourse.julialang.org/t/groupby-for-regular-array/9877/2 "2018-03-22T06:04:33Z")

</div>

Never mind. There is already a good post.

> [@Allocation - groupby](https://discourse.julialang.org/t/allocation-groupby/7505):
>
> I’m attempting to create a function groupby(f, itr) that returns a dictionary whose keys are the results of applying f to the elements of itr, and the values are some collection of the elements themselves. Similar to Mathematica’s [GroupBy](http://reference.wolfram.com/language/ref/GroupBy.html). Example, groupby(iseven, 1:5) --\> Dict(true=\>(2, 4), false =\>(1, 3, 5)). The type of the values doesn’t need to be a tuple if there’s a better alternative. This is partly because I need it, and partly because I’m learning Julia. So, both answers that explain …

---

_[View the full topic](https://discourse.julialang.org/t/groupby-for-regular-array/9877)._
