tuple_selecttuple_selectTupleSelectTupleSelecttuple_select (Operator)
Name
tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
— Select single elements of a tuple.
Signature
def tuple_select(tuple: MaybeSequence[Union[float, int, str]], index: MaybeSequence[int]) -> Sequence[Union[float, int, str]]
def tuple_select_s(tuple: MaybeSequence[Union[float, int, str]], index: MaybeSequence[int]) -> Union[float, int, str]
Description
tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
selects one or more single elements of the tuple
TupleTupleTupletupletuple
and returns them with SelectedSelectedSelectedselectedselected
. At this,
IndexIndexIndexindexindex
determines the indices of the elements to select. Thus,
IndexIndexIndexindexindex
may only contain integer values (any floating point
number within IndexIndexIndexindexindex
must represent an integer value without
fraction). Indices of tuple elements start at 0, that means, the first
tuple element has got the index 0.
Exception: Empty input tuples
If TupleTupleTupletupletuple
is empty, an exception is raised.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
,
which can be used in an expression in the following syntax:
Selected := Tuple[Index]
Selected := subset(Tuple, Index)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
TupleTupleTupletupletuple
(input_control) tuple(-array) →
HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
IndexIndexIndexindexindex
(input_control) integer(-array) →
HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Indices of the elements to select.
SelectedSelectedSelectedselectedselected
(output_control) tuple(-array) →
HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Selected tuple element.
Alternatives
tuple_first_ntuple_first_nTupleFirstNTupleFirstNtuple_first_n
,
tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n
,
tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select
,
tuple_concattuple_concatTupleConcatTupleConcattuple_concat
,
tuple_select_rangetuple_select_rangeTupleSelectRangeTupleSelectRangetuple_select_range
,
tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRanktuple_select_rank
See also
tuple_removetuple_removeTupleRemoveTupleRemovetuple_remove
Module
Foundation