[NumPy-Tickets] [NumPy] #1863: Buggy results when operating on array copied with astype()
NumPy Trac
numpy-tickets@scipy....
Thu Jun 9 10:18:41 CDT 2011
#1863: Buggy results when operating on array copied with astype()
-------------------------+--------------------------------------------------
Reporter: embray | Owner: somebody
Type: defect | Status: closed
Priority: normal | Milestone: 1.6.1
Component: numpy.core | Version: 1.6.0
Resolution: fixed | Keywords:
-------------------------+--------------------------------------------------
Changes (by mwiebe):
* status: new => closed
* version: devel => 1.6.0
* resolution: => fixed
* milestone: Unscheduled => 1.6.1
Comment:
This bug turns out to be much more longstanding than is implied by it
showing up in astype. It's a bit trickier, but possible to expose it in
1.6 as well:
{{{
>>> np.__version__
'1.6.1.dev-878ab94'
>>> a = np.arange(24).reshape(2,3,4).swapaxes(0,1)
>>> a.strides
(16, 48, 4)
>>> b = np.zeros_like(a)
>>> b.strides
(16, 48, 4)
>>> a.flags.c_contiguous
False
>>> b.flags.c_contiguous
True
}}}
The C_CONTIGUOUS flag should not be set in this case, and that's what was
happening in the bug report example too, just with a simpler array and
different function call.
Fixed in commit:a1e7be3 (master) and commit:5765325 (1.6.1).
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1863#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list