Welcome!

Deleting every second element in an array

The task is pretty simple the solution is it as well:

I've got an array that is too big to be shown for pylab's imshow. Without cropping it a segmentation fault occurs. The idea is to reduce the size by deleting every second element. This is how you do it:

 

data = np.random.rand(4000,4000)
smaler_data = data[::2, ::2]

<< Zurück zur vorherigen Seite