I admit that I have only a basic understanding of the way Mathematica handles pure functions - enough to be dangerous, unfortunately.
I have some data that is in a list of lists of lists. I would like to apply a function over a subset of each of those (top level) lists, and I'm wondering if there is a way to do it with mapping rather than using Table. In the following example I have three lists of ordered pairs. I'd like to quickly select a subset of each of those three top level lists by testing a property of the deepest level elements. Doing it for one of the three is easy:
testList = Table[Table[{i, RandomReal[]}, {i, 100}], {j, 1, 3}];
subset1 = Select[testList[[1]], PrimeQ[#[[1]]]&];
What I'm wondering is whether or not there is some way to do something like this:
subsetList = Select[<argument>, PrimeQ[#[[1]]]&] & /@ testList
where "argument" is some sort of indicator that it should be mapped "outside" to the testList level. I'm sure there's some obvious use of Apply or some such that can do this, I just can't quite figure it out!
Select[#, PrimeQ[#[[1]]]&] & /@ testList
? $\endgroup$