This is from the Document center.
In[548]:= Pick[f[1, 2, 3, 4, 5, 6], {1, 0, 1, 0, 1, 1}, 1]
Out[548]= f[1, 3, 5, 6]
Can anyone explain how this work when data is not a list?
Pick[list,sel,patt]
picks out those elements of list for which the corresponding element of sel matches patt.
How do they determine corresponding element when they aren't the same type? Also not even a list?
EDIT: Do they rely on level to determine corresponding element? How about this case?
sel = {1, Cos[1], Sin[1]};
list = {a, b, f[b]};
Pick[list, sel, 1]
Why is the output {a, f[b]}
not {a, b}
because only 1
in Sin[1]
matches the pattern instead?