I have a problem where I need to remove alternate columns and rows of a 2D numpy array.
I've tried using numpy.delete to do so but the results didn't turn out what I want to be...
for x in range(rows):
if x %2 ==0:
array_np=np.delete(array_np,1,axis=1)
for y in range(columns):
if y %2 ==0:
array_np=np.delete(array_np,1,axis=0)
for eg.
[[1,2,3,4],
[5,6,7,8],
[9,10,11,12],
[13,14,15,16]]
expected output:
[[1,3],
[9,11]]
The array is quite large in size than this, but the idea is the same.