Occurrences - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ListTools

  

Occurrences

  

number of occurrences in a list

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Occurrences(x, L)

Occurrences(x, L, f, opts)

Parameters

x

-

anything

L

-

list

f

-

(optional) boolean valued procedure

opts

-

(optional) extra arguments to procedure f

Description

• 

The Occurrences(x, L) command returns the number of entries in the list L which equal x using a boolean comparison.

  

If a function f is provided, equality is tested using f(x, L[i], opts) for each element  in the list.

Examples

(1)

(2)

The number of entries approximately equal to 3.263.

(3)

In the following example, the Occurrences command is used in conjunction with the ListTools:-FindRepetitions command to find the mode of a list with alpha-numeric values:

(4)

(5)

See Also

list

ListTools

type/list

verify

 


Download Help Document