tuple_first_ntuple_first_nTupleFirstNTupleFirstNtuple_first_n (算子)
名称
tuple_first_ntuple_first_nTupleFirstNTupleFirstNtuple_first_n — 选择元组中索引 “n” 之前的第一个元素。
签名
def tuple_first_n(tuple: MaybeSequence[Union[float, int, str]], index: int) -> Sequence[Union[float, int, str]]
def tuple_first_n_s(tuple: MaybeSequence[Union[float, int, str]], index: int) -> Union[float, int, str]
描述
tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstNtuple_first_n selects the first elements of TupleTupleTupleTupletupletuple
up to the index IndexIndexIndexIndexindexindex and returns them in SelectedSelectedSelectedSelectedselectedselected.
Indices of tuple elements start at 0,
that means, the first tuple element has got the index 0. In total,
IndexIndexIndexIndexindexindex+1 elements are returned.
IndexIndexIndexIndexindexindex must contain a single integer value (or a floating point
number that represents an integer value without fraction).
例外:空输入元组
If TupleTupleTupleTupletupletuple is empty, an exception is raised.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstNtuple_first_n,
which can be used in an expression in the following syntax:
Selected := firstn(Tuple, Index)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
TupleTupleTupleTupletupletuple (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
IndexIndexIndexIndexindexindex (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the last element to select.
SelectedSelectedSelectedSelectedselectedselected (输出控制) 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_last_ntuple_last_nTupleLastNTupleLastNTupleLastNtuple_last_n,
tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select,
tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select,
tuple_concattuple_concatTupleConcatTupleConcatTupleConcattuple_concat,
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMasktuple_select_mask
另见
tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemovetuple_remove
模块
基础