Selection.
to_list
(length=None)¶Provide the values of the Selection
as a list of integers.
Parameters: | length ( |
||
---|---|---|---|
Returns: | ( |
||
Raises: |
|
If the Selection
is reversed, the length
over which it will
be applied needs to be provided, so that the actual selected positions can
be determined.
In [1]: sr = ~ss
...: ss.to_list(25)
...:
Out[1]: [3, 4, 5, 13, 14, 15, 21, 25]
Example
In [2]: from rstoolbox.components import Selection
...: ss = Selection("3-5,13-15,21,25")
...: ss.to_list()
...:
Out[2]: [3, 4, 5, 13, 14, 15, 21, 25]