I have a huge list longList
that I want to split into two parts depending on whether an element of the list satisfies the condition: f[#]< 0.1
or not. My question is what is the most efficient way of doing this? The output should be two lists, the first one containing all elements of longList
that satisfy the condition and the second one all the rest.
So far I've tried:
temp = GroupBy[longList, f[#] < 0.1 &];
{list1, list2} = {temp[True], temp[False]};
But it's not fast enough and if I wrap GroupBy
in Parallelize
I get an error saying that it cannot be parallelized.
Map[f[#] < 0.1 &, longList]
andParallelMap
? $\endgroup$f
is and what the list elements are? $\endgroup$