[Numpy-discussion] np.where: x and y need to have the same shape as condition ?

2013-01-29 Thread denis
Folks, the doc for `where` says x and y need to have the same shape as condition http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.where.html But surely where is equivalent to: [xv if c else yv for (c,xv,yv) in zip(condition,x,y)] holds as long as len(condition) == len(x) ==

Re: [Numpy-discussion] np.where: x and y need to have the same shape as condition ?

2013-01-29 Thread Benjamin Root
On Tue, Jan 29, 2013 at 6:16 AM, denis denis-bz...@t-online.de wrote: Folks, the doc for `where` says x and y need to have the same shape as condition http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.where.html But surely where is equivalent to: [xv if c else yv for