pyyeti.locate.find_vals

pyyeti.locate.find_vals(m, v)[source]

Find all occurrences of all values in v in m

Parameters:
  • m (array_like) – Array to be searched.

  • v (array_like) – Array of values to find in m.

Returns:

ndarray – True/False vector with True indicating position of any value in v within m. Will be all False if no values in v are in m.

Notes

m is flattened to 1d before searching (using column-major ordering ‘F’). The values in pv correspond to:

[  0      r  ...
   1    r+1
 ...    ...
 r-1   2r-1  ... r*c-1 ]  where m is r x c

Examples

>>> import numpy as np
>>> from pyyeti import locate
>>> m = np.array([[10, 20], [30, 20]])
>>> locate.find_vals(m, 20)
array([False, False,  True,  True], dtype=bool)
>>> locate.find_vals(m, 30)
array([False,  True, False, False], dtype=bool)
>>> locate.find_vals(m, 100)
array([False, False, False, False], dtype=bool)