tuple_findtuple_findTupleFindTupleFindtuple_find (算子)
名称
tuple_findtuple_findTupleFindTupleFindtuple_find — 返回一个元组在另一个元组中的所有出现的索引。
签名
def tuple_find(tuple: MaybeSequence[Union[float, int, str]], to_find: MaybeSequence[Union[float, int, str]]) -> Sequence[int]
def tuple_find_s(tuple: MaybeSequence[Union[float, int, str]], to_find: MaybeSequence[Union[float, int, str]]) -> int
描述
tuple_findtuple_findTupleFindTupleFindTupleFindtuple_find searches TupleTupleTupleTupletupletuple sequentially for all
occurrences of the values of the second tuple ToFindToFindToFindToFindtoFindto_find and
returns the indices in IndicesIndicesIndicesIndicesindicesindices (in relation to the first
input tuple TupleTupleTupleTupletupletuple). For example, if TupleTupleTupleTupletupletuple
contains the values [3,4,5,6,1,2,3,4,0] and ToFindToFindToFindToFindtoFindto_find contains
the values [3,4], the output tuple IndicesIndicesIndicesIndicesindicesindices will contain the
values [0,6]. If the first tuple does not contain the second tuple
as a subtuple, tuple_findtuple_findTupleFindTupleFindTupleFindtuple_find returns -1 in IndicesIndicesIndicesIndicesindicesindices. It
is allowed to mix strings and numbers in the input tuples.
例外:空输入元组
If either or both of the input tuples are empty, the operator returns an
empty tuple.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_findtuple_findTupleFindTupleFindTupleFindtuple_find,
which can be used in an expression in the following syntax:
Indices := find(Tuple, ToFind)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
TupleTupleTupleTupletupletuple (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple to examine.
ToFindToFindToFindToFindtoFindto_find (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple with values to find.
IndicesIndicesIndicesIndicesindicesindices (输出控制) integer(-array) → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Indices of the occurrences of the values to find in the
tuple to examine.
替代
tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirstTupleFindFirsttuple_find_first,
tuple_find_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLasttuple_find_last,
tuple_sorttuple_sortTupleSortTupleSortTupleSorttuple_sort,
tuple_inversetuple_inverseTupleInverseTupleInverseTupleInversetuple_inverse,
tuple_equal_elemtuple_equal_elemTupleEqualElemTupleEqualElemTupleEqualElemtuple_equal_elem
模块
基础