tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMasktuple_select_mask (算子名称)
名称
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMasktuple_select_mask — Select in mask specified elements of a tuple.
参数签名
def tuple_select_mask(tuple: MaybeSequence[Union[float, int, str]], mask: MaybeSequence[int]) -> Sequence[Union[float, int, str]]
def tuple_select_mask_s(tuple: MaybeSequence[Union[float, int, str]], mask: MaybeSequence[int]) -> Union[float, int, str]
描述
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMasktuple_select_mask selects one or more single elements of the tuple
TupleTupleTupleTupletupletuple and returns them with SelectedSelectedSelectedSelectedselectedselected. For every element
MaskMaskMaskMaskmaskmask determines the corresponding element to select.
If the value is greater than 0, the appropriate element is selected.
Thus the length of the two input tuples has to be equal and
MaskMaskMaskMaskmaskmask may only contain integer or float values.
Exception: Empty input tuples
If both input tuples are empty, 该算子 returns an
empty tuple. If only one of the input tuples is empty and the other is not,
an exception is raised.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMasktuple_select_mask,
which can be used in an expression in the following syntax:
Selected := select_mask(Tuple, Mask)
运行信息
- Multithreading type: independent (runs in parallel even with exclusive operators).
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
参数表
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.
MaskMaskMaskMaskmaskmask (input_control) integer(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
> 0 specifies 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 elements.
可替代算子
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_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select,
tuple_select_rangetuple_select_rangeTupleSelectRangeTupleSelectRangeTupleSelectRangetuple_select_range,
tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRanktuple_select_rank
参考其它
tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemovetuple_remove
模块
Foundation