Elementwise contains. Parameters ---------- substring : str Returns ------- matches : np.ndarray[bool] An array with the same shape as self indicating whether each element of self ended with ``suffix``.
(self, substring)
| 759 | return self.map_predicate(lambda elem: elem.endswith(suffix)) |
| 760 | |
| 761 | def has_substring(self, substring): |
| 762 | """ |
| 763 | Elementwise contains. |
| 764 | |
| 765 | Parameters |
| 766 | ---------- |
| 767 | substring : str |
| 768 | |
| 769 | Returns |
| 770 | ------- |
| 771 | matches : np.ndarray[bool] |
| 772 | An array with the same shape as self indicating whether each |
| 773 | element of self ended with ``suffix``. |
| 774 | """ |
| 775 | return self.map_predicate(lambda elem: substring in elem) |
| 776 | |
| 777 | @preprocess(pattern=coerce(from_=(bytes, unicode), to=re.compile)) |
| 778 | def matches(self, pattern): |