tuple_selecttuple_selectTupleSelectTupleSelecttuple_select (算子名称)

名称

tuple_selecttuple_selectTupleSelectTupleSelecttuple_select — Select single elements of a tuple.

参数签名

tuple_select( : : Tuple, Index : Selected)

Herror tuple_select(const Hlong Tuple, const Hlong Index, Hlong* Selected)

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

void TupleSelect(const HTuple& Tuple, const HTuple& Index, HTuple* Selected)

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

static void HOperatorSet.TupleSelect(HTuple tuple, HTuple index, out HTuple selected)

HTuple HTuple.TupleSelect(HTuple index)

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]

描述

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

HDevelop In-line Operation

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

Selected := Tuple[Index]

Selected := subset(Tuple, Index)

运行信息

参数表

TupleTupleTupleTupletupletuple (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.

IndexIndexIndexIndexindexindex (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices of the elements to select.

SelectedSelectedSelectedSelectedselectedselected (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.

可替代算子

tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstNtuple_first_n, tuple_last_ntuple_last_nTupleLastNTupleLastNTupleLastNtuple_last_n, tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select, tuple_concattuple_concatTupleConcatTupleConcatTupleConcattuple_concat, tuple_select_rangetuple_select_rangeTupleSelectRangeTupleSelectRangeTupleSelectRangetuple_select_range, tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRanktuple_select_rank

参考其它

tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemovetuple_remove

模块

Foundation