I am trying to calculate the beginning and offset of variable sized arrays and store them in a dictionary. Here is the likely non-pythonic way that I achieve this. I'm not sure if I should look for a map, lambda function or list to make the code more pythonic.
Essentially, I need to cut out the pieces of the array based on the total size and store the words xstart, ystart, x_number_of_rows_to_read, y_number_of_columns_to_read in the dictionary. The total size is variable. I cannot load the entire array into memory and use numpy indexing, or I would definitely like to. The beginning and offset are used to get the array in numpy.
intervalx = xsize / xsegment
I understand that xrange is not ideal for port up to 3.
source share