splitting numpy array unevenly
Martin De Kauwe
mdekauwe at gmail.com
Mon Sep 17 19:43:05 EDT 2012
On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote:
> I need to divide a 512x512 image array with the first horizontal and vertical division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit want to start at the edges and create a bunch of same size arrays. Is there a command to chop off different sized arrays?
>
>
>
> Thanks
I don't know that I follow completely, but can't you just slice what you are after?
x = np.random.rand(512*512).reshape(512,512)
xx = x[0,:49]
And put the rest of the slices in a loop...?
More information about the Python-list
mailing list