numpy.char.rindex#
- char.rindex(a, sub, start=0, end=None)[source]#
類似於
rfind
,但當找不到子字串 sub 時,會引發ValueError
。- 參數:
- aarray-like,具有 np.bytes_ 或 np.str_ dtype
- subarray-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])