1 year ago

#358215

test-img

Philipp

Resize a numpy array to 2048 rows

I am looking for a way to resize NumPy arrays with 3 columns and different rows (e.g. number of rows = 3000, 5234, 2650,...)

What I am trying to do is set the number of rows to 2048 while still having 3 columns. But the deleted rows should be random.

What I did is:

array_2 = array_1[::2, :]

But with that method, I can only divide the number of rows e.g. by to.

I hope I was able to state my question clearly.

python

numpy-ndarray

numpy-slicing

0 Answers

Your Answer

Accepted video resources