We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
char.rfind
1 parent 98b5aa5 commit 9a8a2e1Copy full SHA for 9a8a2e1
numpy/_core/strings.py
@@ -199,9 +199,9 @@ def mod(a, values):
199
200
Examples
201
--------
202
- >>> np.char.mod("%.3f", [1, 2, 3])
+ >>> np.strings.mod("%.3f", [1, 2, 3])
203
array(['1.000', '2.000', '3.000'], dtype='<U5')
204
- >>> np.char.mod("0x%02x", [8, 9, 10, 11])
+ >>> np.strings.mod("0x%02x", [8, 9, 10, 11])
205
array(['0x08', '0x09', '0x0a', '0x0b'], dtype='<U4')
206
207
"""
@@ -270,6 +270,20 @@ def rfind(a, sub, start=0, end=None):
270
271
str.rfind
272
273
+ Examples
274
+ --------
275
+
276
+ While `string.find` returns the lowest index:
277
278
+ >>> a = np.array(["very repetitive very repetitive very"])
279
+ >>> np.strings.find(a, "very")
280
+ array([0])
281
282
+ `string.rfind` returns the highes index:
283
284
+ >>> np.strings.rfind(a, "very")
285
+ array([32])
286
287
288
end = end if end is not None else MAX
289
return _rfind_ufunc(a, sub, start, end)
0 commit comments