<br><br><div><span class="gmail_quote">On 8/29/07, <b class="gmail_sendername">Christopher Barker</b> <<a href="mailto:Chris.Barker@noaa.gov">Chris.Barker@noaa.gov</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Charles R Harris wrote:<br>> What *should* the resize method do? It looks like<br>> it is equivalent to assigning a shape tuple to a.shape,<br><br>No, that's what reshape does.</blockquote><div><br>No, reshape returns a view and the view doesn't own its data. Totally different behavior in this context. 
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> > so why do we need it?<br><br>resize() will change the SIZE of the array (number of elements), where
<br>reshape() will only change the shape, but not the number of elements.<br>The fact that the size is changing is why it won't work if if doesn't<br>own the data.</blockquote><div><br>According to the documentation, the resize method changes the array inplace. How can it be inplace if the number of elements changes? Admittedly, it *will* change the size, but that is not consistent with the documentation. I suspect it reallocates memory and (hopefully) frees the old, but then that is what the documentation should say because it explains why the data must be owned -- a condition violated in some cases as demonstrated above. I am working on documentation and that is why I am raising these questions. There seem to be some inconsistencies that need clarification and/or fixing.
<br></div><br>Chuck<br></div><br>