select data items satisfying a condition - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics : Statistics Package : Data Manipulation : Statistics/Select

Statistics[Select] - select data items satisfying a condition

Statistics[Remove] - remove data items satisfying a condition

Calling Sequence

Select(func, X)

Remove(func, X)

Parameters

func

-

boolean-valued procedure

X

-

data sample

options

-

(optional) extra arguments to func

Description

• 

The Select function selects the items data[i] for which funcXi,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.

Examples

withStatistics:

L:=3,3,1,1,a,b,b,a,π,sin4

L:=3,3,1,1,a,b,b,a,π,sin4

(1)

Selecttype,L,realcons

3,3,1,1,π,sin4

(2)

Removetype,L,realcons

a,b,b,a

(3)

A:=ArrayL

A:=3311abbaπsin4

(4)

Selecttype,A,realcons

3311πsin4

(5)

Selectt&rarr;is0<t&comma;A

3311&pi;

(6)

Removetype&comma;A&comma;name

3311sin4

(7)

See Also

remove, select, selectremove, Statistics, Statistics[Computation], Statistics[RemoveInRange], Statistics[RemoveNonNumeric], Statistics[SelectInRange], Statistics[SelectNonNumeric]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam