recipes.
regexfind
(arr, expr)[source]¶Find regular expression in a NumPy array
Parameters: | arr : NumPy 1darray
expr : str
|
---|---|
Returns: | ind : NumPy 1darray
|
See also
Examples
Suppose the array arr is given by
>>> arr
array(['L_a', 'L_b', 'R_a', 'R_b'],
dtype='|S3')
If we want to find all elements of arr starting with l_ or L_ we could use
>>> regexfind(arr,"[Ll]_*")
array([0, 1])