I have a subclass of ndarray that implements loading / saving one or more records into a flat binary. After downloading the records, I can access them in normal NumPy mode.
My question is what will happen when I slice the result (or, indeed, any NumPy array). Usually this creates a "view", i.e. an array that refers to the same buffer as the parent array.
Once I have this view, is there a way to determine the position of the view V in array A? More precisely, I would like to know the byte offset (starting from the beginning of the data buffer) from which V. begins. This will allow me to write the slice back to disk with the correct offset.
Here is a sample code to show the situation :
source share