Skip to main content
17 events
when toggle format what by license comment
Feb 22, 2018 at 7:26 vote accept Kuba
Feb 16, 2016 at 23:48 answer added Ronald Monson timeline score: 2
Feb 16, 2016 at 21:56 answer added Mr.Wizard timeline score: 6
Feb 15, 2016 at 18:01 answer added WReach timeline score: 15
Feb 15, 2016 at 15:02 comment added Kuba @J.M. because it won't work in general: GroupBy[dataset, {#type &, #subtype &, #type &, #subtype &}]. However, GroupBy[dataset, {#type &, #subtype &, #type &, #subtype &}, Map[f, #, {3}] &] would be kind of ok, since 3 is 4-1 :P (take a look at gwr's answer)
Feb 15, 2016 at 14:57 history tweeted twitter.com/StackMma/status/699246074704371712
Feb 15, 2016 at 14:54 answer added gwr timeline score: 5
Feb 15, 2016 at 14:51 comment added J. M.'s missing motivation Why is GroupBy[dataset, {#type &, #subtype &}, Map[First]] not suitable?
Feb 15, 2016 at 14:25 history edited Kuba CC BY-SA 3.0
edited title
Feb 15, 2016 at 14:09 answer added Leonid Shifrin timeline score: 9
Feb 15, 2016 at 13:52 comment added Kuba @gwr I didn't, this is quite nice. The "full nested" approach is "better" in that sense that you can still take nested["a"] or nested[[All, "I"]].
Feb 15, 2016 at 13:44 comment added gwr Did you note GroupBy[ dataset, {#type, #subtype}& ] which leads to a more controlled levelspec (this is also robust for your mimic extended case)? Maybe nested[ {"a", "I" }, "value"] is an option?
Feb 15, 2016 at 13:30 answer added Edmund timeline score: 10
Feb 15, 2016 at 13:12 comment added Kuba @gwr unfortunately, it is not general enough. We may have more levels, you can mimic it with: GroupBy[dataset, {#type &, #subtype &, #type &, #subtype &}], now you would have to adjust levelspec of Apply, and using negative levels may be problematic because the input may be more complex than a list of 1-lvl associations.
Feb 15, 2016 at 13:09 comment added gwr What about something like GroupBy[ dataset, {#type &, #subtype &}, Apply[ Association, #, 1 ] & ]?
Feb 15, 2016 at 12:53 history edited Kuba CC BY-SA 3.0
edited title
Feb 15, 2016 at 12:46 history asked Kuba CC BY-SA 3.0