I have a rank-1 numpy.array of which I want to make a boxplot. However, I want to exclude all values equal to zero in the array. Currently, I solved this by loo
numpy.array
A simple line of code can get you an array that excludes all '0' values:
np.argwhere(*array*)
example:
import numpy as np array = [0, 1, 0, 3, 4, 5, 0] array2 = np.argwhere(array) print array2 [1, 3, 4, 5]