def test_arrmap(): values = np.array(['foo', 'foo', 'bar', 'bar', 'baz', 'qux'], dtype='O') result = lib.arrmap_object(values, lambda x: x in ['foo', 'bar']) assert(result.dtype == np.bool_)
def test_arrmap(): values = np.array(['foo', 'foo', 'bar', 'bar', 'baz', 'qux'], dtype='O') result = lib.arrmap_object(values, lambda x: x in ['foo', 'bar']) assert (result.dtype == np.bool_)
def map(self, mapper): return lib.arrmap_object(self.values, mapper)