Basic Examples 
(4)
 

Determine the proportion of a list of integers that is
EvenQ
:
In[1]:=
[◼]
ProportionsBy
[{1,2,3,2,1,1},EvenQ]
Out[1]=
False
2
3
,True
1
3

———
Get the proportion of a list that is
PrimeQ
:
In[2]:=
[◼]
ProportionsBy
[Range[1000],PrimeQ]
Out[2]=
False
104
125
,True
21
125

———
Use with an
Association
:
In[1]:=
[◼]
ProportionsBy
["a"1,"b"2,"c"3,"d"2,"e"1,"f"1,EvenQ]
Out[1]=
False
2
3
,True
1
3

———
Use the operator form of
ProportionsBy
:
In[1]:=
primeProportions=
[◼]
ProportionsBy
[PrimeQ]
Out[1]=
[◼]
ProportionsBy
[PrimeQ]
In[2]:=
Range[1000]//primeProportions
Out[2]=
False
104
125
,True
21
125


Scope 
(2)
 


Properties and Relations 
(1)
 
