I've specifically not tuned it, primarily because the get the best tuning
you need to know the likelihood of finding a match. One option would be to
allow users to specify a "probability" parameter which would chunk the
array into size*probability chunks - an additional parameter could then be
expo
On Tue, Mar 26, 2013 at 9:20 AM, Phil Elson wrote:
> Bump.
>
> I'd be interested to know if this is a desirable feature for numpy?
> (specifically the 1D "find" functionality rather than the "any"/"all" also
> discussed)
> If so, I'd be more than happy to submit a PR, but I don't want to put in th
Bump.
I'd be interested to know if this is a desirable feature for numpy?
(specifically the 1D "find" functionality rather than the "any"/"all" also
discussed)
If so, I'd be more than happy to submit a PR, but I don't want to put in
the effort if the principle isn't desirable in the core of numpy.
Interesting. I hadn't thought of those. I've implemented (very roughly
without a sound logic check) and benchmarked:
def my_any(a, predicate, chunk_size=2048):
try:
next(find(a, predicate, chunk_size))
return True
except StopIteration:
return False
def my_all(a, pr
On Tue, Mar 5, 2013 at 9:15 AM, Phil Elson wrote:
> The ticket https://github.com/numpy/numpy/issues/2269 discusses the
> possibility of implementing a "find first" style function which can
> optimise the process of finding the first value(s) which match a predicate
> in a given 1D array. For exa
The ticket https://github.com/numpy/numpy/issues/2269 discusses the
possibility of implementing a "find first" style function which can
optimise the process of finding the first value(s) which match a predicate
in a given 1D array. For example:
>>> a = np.sin(np.linspace(0, np.pi, 200))
>>> print