[Numpy-discussion] Bug in as_strided/reshape

Dave Hirschfeld dave.hirschfeld at gmail.com
Fri Aug 10 03:35:15 EDT 2012

Sebastian Berg <sebastian <at> sipsolutions.net> writes:

> Hello,
> looking at the code, when only adding/removing dimensions with size 1,
> numpy takes a small shortcut, however it uses 0 stride lengths as value
> for the new one element dimensions temporarily, then replacing it again
> to ensure the new array is contiguous.
> This replacing does not check if the dimension has more then size 1.
> Likely there is a better way to fix it, but the attached diff should do
> it.
> Regards,
> Sebastian

Thanks for the confirmation. So this doesn't get lost I've opened issue #380 on 



More information about the NumPy-Discussion mailing list