For each element in `a`, return the highest index in the string where substring `sub` is found, such that `sub` is contained within [`start`, `end`]. Calls `str.rfind` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode s
(a, sub, start=0, end=None)
| 1281 | |
| 1282 | @array_function_dispatch(_count_dispatcher) |
| 1283 | def rfind(a, sub, start=0, end=None): |
| 1284 | """ |
| 1285 | For each element in `a`, return the highest index in the string |
| 1286 | where substring `sub` is found, such that `sub` is contained |
| 1287 | within [`start`, `end`]. |
| 1288 | |
| 1289 | Calls `str.rfind` element-wise. |
| 1290 | |
| 1291 | Parameters |
| 1292 | ---------- |
| 1293 | a : array-like of str or unicode |
| 1294 | |
| 1295 | sub : str or unicode |
| 1296 | |
| 1297 | start, end : int, optional |
| 1298 | Optional arguments `start` and `end` are interpreted as in |
| 1299 | slice notation. |
| 1300 | |
| 1301 | Returns |
| 1302 | ------- |
| 1303 | out : ndarray |
| 1304 | Output array of ints. Return -1 on failure. |
| 1305 | |
| 1306 | See Also |
| 1307 | -------- |
| 1308 | str.rfind |
| 1309 | |
| 1310 | """ |
| 1311 | return _vec_string( |
| 1312 | a, int_, 'rfind', [sub, start] + _clean_args(end)) |
| 1313 | |
| 1314 | |
| 1315 | @array_function_dispatch(_count_dispatcher) |
no test coverage detected