MCPcopy Index your code
hub / github.com/pydata/xarray / rfind

Method rfind

xarray/core/accessor_str.py:1761–1791  ·  view source on GitHub ↗

Return highest indexes in each strings in the array where the substring is fully contained between [start:end]. Return -1 on failure. If `start`, `end`, or 'sub` is array-like, they are broadcast against the array and applied elementwise. Parameters

(
        self,
        sub: str | bytes | Any,
        start: int | Any = 0,
        end: int | Any = None,
    )

Source from the content-addressed store, hash-verified

1759 return self._apply(func=func, func_args=(sub, start, end), dtype=int)
1760
1761 def rfind(
1762 self,
1763 sub: str | bytes | Any,
1764 start: int | Any = 0,
1765 end: int | Any = None,
1766 ) -> T_DataArray:
1767 """
1768 Return highest indexes in each strings in the array
1769 where the substring is fully contained between [start:end].
1770 Return -1 on failure.
1771
1772 If `start`, `end`, or 'sub` is array-like, they are broadcast
1773 against the array and applied elementwise.
1774
1775 Parameters
1776 ----------
1777 sub : str or array-like of str
1778 Substring being searched.
1779 If array-like, it is broadcast.
1780 start : int or array-like of int
1781 Left edge index.
1782 If array-like, it is broadcast.
1783 end : int or array-like of int
1784 Right edge index.
1785 If array-like, it is broadcast.
1786
1787 Returns
1788 -------
1789 found : array of int
1790 """
1791 return self.find(sub, start=start, end=end, side="right")
1792
1793 def index(
1794 self,

Callers 3

test_empty_str_methodsFunction · 0.80
test_findFunction · 0.80
test_find_broadcastFunction · 0.80

Calls 1

findMethod · 0.95

Tested by 3

test_empty_str_methodsFunction · 0.64
test_findFunction · 0.64
test_find_broadcastFunction · 0.64