<br><br><div class="gmail_quote">On Sat, Sep 22, 2012 at 7:54 AM, Gael Varoquaux <span dir="ltr"><<a href="mailto:gael.varoquaux@normalesup.org" target="_blank">gael.varoquaux@normalesup.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi list,<br>
<br>
I am struggling with offsets on the view of a memmaped array. Consider<br>
the following:<br>
<br>
import numpy as np<br>
<br>
a = np.memmap('tmp.mmap', dtype=np.float64, shape=50, mode='w+')<br>
a[:] = np.arange(50)<br>
b = a[10:]<br>
<br>
Here, I have a.offset == 0 and b.offset == 0. In practice, the data in b<br>
is offset compared to the start of the file, given that it is a view<br>
computed with an offset.<br>
<br>
My goal is, given b, to find a way to open a new view on the file, e.g.<br>
in a different process. For this I need the offset.<br>
<br>
Any idea of how I can retrieve it? In the previous numpy versions, I<br>
could go from b to a using the 'base' attribute of a. This is no longer<br>
possible.<br>
<br>
Also, should the above behavior be considered as a bug?<br></blockquote><div><br>I think this is a bug, taking a view should probably update the offset.<br><br>Chuck <br></div><br></div>