MCPcopy
hub / github.com/quantopian/zipline / has_substring

Method has_substring

zipline/lib/labelarray.py:761–775  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 2

test_compare_to_strMethod · 0.95

Calls 1

map_predicateMethod · 0.95

Tested by 2

test_compare_to_strMethod · 0.76