Thanks for the advice, guys!

I'm back at work on Thursday, if no one has patched the code before then,
I'll do it myself.


On Tue, Oct 1, 2013 at 10:35 PM, seberg <notifications@github.com> wrote:

> In numpy/lib/function_base.py:
>
> > +        result=np.ones_like(condlist[0])*default
> > +        for i in range(0,len(condlist)):
> > +            result[condlist[i]]=choicelist[i]
> > +        return result
> > +
> > +    # otherwise, we have to broadcast
> > +    # for numpy 1.7, you have to broadcast the indexes by hand.
> > +    # numpy 1.6 did it automatically, I think?
> > +
> > +    to_broadcast = condlist + choicelist      # make into a single big list
> > +    bc=np.broadcast_arrays(*to_broadcast)     # unpack values from big list and broadcast them
> > +    condlist=bc[:len(bc)//2]                   # split the bc'd big list back into 2 parts again
> > +    choicelist=bc[len(bc)//2:]                 # down the middle
> > +
> > +    # Setup an array filled with default values
> > +    result=np.ones_like(condlist[0])*default
>
> Use the dtype as given above. Condlist[0] may have the correct shape, but
> it certainly does not have the correct data type.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/numpy/numpy/pull/3537/files#r6698613>
> .
>