« first day (1785 days earlier)   

2:22 AM
everyone fall asleep in here?
 
 
4 hours later…
6:16 AM
Nope, of course not.
Question: Assume a very simple Dataset
ds = Dataset[Table[Association["value" -> RandomReal[]], 10]]
What I want is to separate this Dataset into values that are smaller and larger 0.5 and I need a list {{small1, small2, ...}, {large1, large2, ...}}. I can do this with
ds[GroupBy[#value >= .5 &] /* KeySort, All, #value &][Values] // Normal
We need the KeySort because the first value in the dataset decides in which order the groups appear. The question is, can I include the final Values inside the first call anywhere?
 
7:16 AM
ds[GroupBy[#value >= .5 & -> (#value &)] /* KeySort /*  Values] // Normal
@halirutan like that ^ ?
 
7:46 AM
@Kuba Simple examples sometimes have the flaw that they are too simple :) The problem is when I have something like this
ds[GroupBy[#value >= .5 &] /* KeySort, All, {#value, #value^2} &][Values] // Normal
Basically, my Dataset is much more complicated and I need to do serious operations on them.
 
8:04 AM
@halirutan then GroupBy[#value >= .5 & -> ({#value, #value2} &)]?
I'm not sure I got your update
 
8:24 AM
@Kuba That seems to work but I'm not sure I like it. Especially with complicated group conditions and a larger calculation.. hmm.
Nevertheless, thank you very much
 
8:38 AM
@halirutan np. so, which step is supposed to grow up to make it ugly. (#value&)?
 

« first day (1785 days earlier)