numpy.strings.rindex#
- strings.rindex(a, sub, start=0, end=None)[源代码]#
与
rfind类似,但当找不到子字符串 sub 时,会引发ValueError.- 参数:
- a : array-like,具有 np.bytes_ 或 np.str_ dtype类数组,具有
- sub : array-like,具有 np.bytes_ 或 np.str_ dtype类数组,具有
- start, endarray-like,具有任何整数 dtype,可选
- 返回:
- outndarray
整数的输出数组.
参见
示例
>>> a = np.array(["Computer Science"]) >>> np.strings.rindex(a, "Science", start=0, end=None) array([9])