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

Online Help

All Products    Maple    MapleSim


index

find index of element within expression sequence

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

x.index(y)

Parameters

x

-

ExpressionSequence object

y

-

Expression or Python expression

Description

• 

The index function returns the index of y within the ExpressionSequence x. If y does not appear in x, a ValueError is raised.

• 

Note that as x is a Maple expression sequence, the index of the first element is 1.

Examples

The following interactive session illustrates the use of index:

>>> import maple

>>> import maple.namespace

>>> S1 = maple.execute('[ a, b, c, 2, 3, 4 ]:')

>>> S1.index( maple.namespace.b )

2

>>> S1.index( 3 )

5

>>> S1.index( maple.namespace.x )

ValueError: is not in expression sequence

See Also

member

OpenMaple

OpenMaple/Python/API

OpenMaple/Python/Expression

OpenMaple/Python/ExpressionSequence