[Numpy-discussion] Ticket #798: `piecewise` exposes raw memory

Stéfan van der Walt stefan@sun.ac...
Wed May 21 04:30:21 CDT 2008


Referring to
http://scipy.org/scipy/numpy/ticket/798

`piecewise` uses `empty` to allocate output memory.  If the conditions
do not sufficiently cover the output, then raw memory is returned,
e.g.,

{{{
import numpy as np
np.piecewise([0,1,2],[True,False,False],[1])
}}}

A patch which addresses the issue is available here for review:

http://codereview.appspot.com/1105

Documentation is being updated on the wiki.


More information about the Numpy-discussion mailing list