<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This is the expected behavior.   It is not a bug. <div><br></div><div>NumPy arrays after pickling are views into the String that is created by the pickling machinery.   Thus, the base is set.  This was done to avoid an additional memcpy. </div><div><br></div><div>This avoids a copy, but yes, it does mean that you can't resize the array until you make another copy. </div><div><br></div><div>Best regards,</div><div><br></div><div>-Travis</div><div><br></div><div><br></div><div><br><div><div>On Jun 30, 2012, at 5:33 PM, Daniel Hyams wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hmmm, I wouldn't think that it is correct behavior; I would think that *any* ndarray arising from pickling would have its .base attribute set to None.  If not, then who is really the one that owns the data? </div>

<div><br></div><div>It was my understanding that .base should hold a reference to another ndarray that the data is really coming from, or it's None.  It certainly shouldn't be some random string, should it?</div>
<div>
<br></div><div>And yes, it is causing a problem for me, which is why I noticed it.  In my application, ndarrays can come from various sources, pickling being one of them.  Later in the app, I was wanting to resize the array, which you cannot do if the data is not really owned by that array...I had explicit check for myarray.base==None, which it is not when I get the ndarray from a pickle.</div>

<br clear="all"><div><br></div>-- <br>Daniel Hyams<br><a href="mailto:dhyams@gmail.com" target="_blank">dhyams@gmail.com</a><br>
_______________________________________________<br>NumPy-Discussion mailing list<br><a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>http://mail.scipy.org/mailman/listinfo/numpy-discussion<br></blockquote></div><br></div></body></html>