>    if np.issubdtype(item.dtype, np.int_):

>needs to be np.integer not np.int_.


Thanks for the suggestion. I think that code was suggested previously
by njsmith.

Can you explain why you feel np.integer is more correct than np.int_?

Graeme.

p.s. I really appreciate your suggestions on this thread, but in general it
will be easier for other people, particularly me, to understand and
double-check your comments/assertions if you explain why you're making them.


On Tue, Oct 1, 2013 at 11:42 PM, seberg <notifications@github.com> wrote:

> In numpy/lib/function_base.py:
>
> > +    # Check that the inputs are acceptable.
> > +
> > +    # Check the size of condlist and choicelist are the same, or abort.
> > +    if len(condlist) != len(choicelist):
> > +        raise ValueError('list of cases must be same length as list of conditions')
> > +
> > +    # If condlist/choicelist are empty, return the default value immediately.
> > +    if len(condlist)==0:
> > +        return np.array([])
> > +
> > +    # If cond array is not an ndarray in boolean format or scalar bool, abort.
> > +    deprecated_ints=False
> > +    for i in range(0,len(condlist)):
> > +        item=np.asarray(condlist[i])
> > +        if item.dtype != np.bool_:
> > +            if np.issubdtype(item.dtype, np.int_):
>
> needs to be np.integer not np.int_.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/numpy/numpy/pull/3537/files#r6700704>
> .
>