Skip to content

tuple_selectTupleSelectTupleSelecttuple_selecttuple_select🔗

Short description🔗

tuple_selectTupleSelectTupleSelecttuple_selecttuple_select — Select single elements of a tuple.

Signature🔗

tuple_select( tuple Tuple, integer Index, out tuple Selected )void TupleSelect( const HTuple& Tuple, const HTuple& Index, HTuple* Selected )static void HOperatorSet.TupleSelect( HTuple tuple, HTuple index, out HTuple selected )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]Herror tuple_select( const Hlong Tuple, const Hlong Index, Hlong* Selected )

Herror T_tuple_select( const Htuple Tuple, const Htuple Index, Htuple* Selected )

HTuple HTuple::TupleSelect( const HTuple& Index ) const

HTuple HTuple.TupleSelect( HTuple index )

Description🔗

tuple_selectTupleSelect selects one or more single elements of the tuple Tupletupletuple and returns them with Selectedselectedselected. At this, Indexindexindex determines the indices of the elements to select. Thus, Indexindexindex may only contain integer values (any floating point number within Indexindexindex 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 Tupletupletuple is empty, an exception is raised.

HDevelop In-line Operation🔗

HDevelop provides an in-line operation for tuple_selectTupleSelect, which can be used in an expression in the following syntax:

Selected := Tuple[Index]

Selected := subset(Tuple, Index)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Tupletupletuple (input_control) tuple(-array) → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)MaybeSequence[Union[float, int, str]]Htuple (Hlong / double / char*)

Input tuple.

Indexindexindex (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Indices of the elements to select.

Selectedselectedselected (output_control) tuple(-array) → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)Sequence[Union[float, int, str]]Htuple (Hlong / double / char*)

Selected tuple element.

Combinations with other operators🔗

Combinations

Alternatives

tuple_first_nTupleFirstN, tuple_last_nTupleLastN, tuple_str_bit_selectTupleStrBitSelect, tuple_concatTupleConcat, tuple_select_rangeTupleSelectRange, tuple_select_rankTupleSelectRank

See also

tuple_removeTupleRemove

Module🔗

Foundation