Wed, 22 Apr 2009 20:18:14 +0200, Fabrice Pardo wrote:
[clip]
> The reshape function is unpredictable and its behaviour is not
> documented.
> 
> It cannot be used safely.

It is documented and it can be used safely. The manual, however, has 
currently no section on views that would explain these issues in depth.

If you want to ensure no-copy, assign to shape:

a.shape = (6,)

> Another remark against reshape:
> OWNDATA flag is False, even if b is a copy !

Apparently, reshape first copies to a contiguous array and then reshapes. 
This could be simplified.

-- 
Pauli Virtanen

_______________________________________________
Numpy-discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to