So far, i do what i want to do is as follows
ar2 = [[0 for t in range(maxy-miny)] for t in range(maxx-minx)]
for first,x in enumerate(range(minx, maxx)):
for second,y in enumerate(range(miny, maxy)):
ar2[first][second] = a[x][y]
io.imshow(ar2)
The problem is that it's really slow. So i'm considering numpy.
ar = np.zeros((maxx-minx, maxy-miny), dtype=np.ndarray)
for first,x in enumerate(range(minx, maxx)):
for second,y in enumerate(range(miny, maxy)):
ar[first][second] = a[x][y]
io.imshow(ar)
Though in the second case, the image won't show
TypeError: Image data can not convert to float
I tried to check what might be going on, so i tested ar[0] & ar2[0]
Output of 2-d Array :
[array([230, 197, 204], dtype=uint8) array([241, 209, 214], dtype=uint8)
array([233, 201, 206], dtype=uint8) array([214, 183, 188], dtype=uint8)...
Output of Numpy Array :
[array([230, 197, 204], dtype=uint8), array([241, 209, 214], dtype=uint8),
array([233, 201, 206], dtype=uint8), ...
So apparently, numpy is using commas but i can't understand how and why it happens.
aor at least the first few elements/rows/columns of a.