Statistics
Select
select data items satisfying a condition
Remove
remove data items satisfying a condition
Calling Sequence
Parameters
Description
Examples
Select(func, X)
Remove(func, X)
func
-
boolean-valued procedure
X
data sample
options
(optional) extra arguments to func
The Select function selects the items data[i] for which func⁡Xi,options returns true, and creates a new data sample with the same options as X. Those items for which func does not return true are discarded in the newly created data sample.
The Remove function does the opposite of Select. It removes the data items of X which satisfy func and creates a new data set.
The first parameter func must be a boolean valued procedure.
The second parameter X is a data sample - given as e.g. a Vector. If X is a list, then the procedures select and remove (and selectremove) do the same thing as Select and Remove, but are slightly faster.
with⁡Statistics:
L≔3,3,1,1,a,b,b,a,π,sin⁡4
Select⁡type,L,realcons
3,3,1,1,π,sin⁡4
Remove⁡type,L,realcons
a,b,b,a
A≔Array⁡L
A≔3311abbaπsin⁡4
Select⁡type,A,realcons
3311πsin⁡4
Select⁡t↦is⁡0<t,A
3311π
Remove⁡type,A,name
3311sin⁡4
See Also
remove
select
selectremove
Statistics[Computation]
Statistics[RemoveInRange]
Statistics[RemoveNonNumeric]
Statistics[SelectInRange]
Statistics[SelectNonNumeric]
Download Help Document