[Numpy-discussion] array view with different shape
Wed Sep 15 04:01:21 CDT 2010
Can I make a view of an entire array but with a different shape?
a = zeros((2,3,4))
Now I want array b to be identical to a, but with shape (2,12).
b = a; b.shape = (2,12)
This doesn't work, of course, as also the shape of a changes.
I know I can simply make a copy of a and change the shape, but can I make b
to be a view of a (so that when I change a, then b changes as well)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion