I have a NumPy array, for example:
a = np.array([1,2,3,4,0,0,5,6,7,8,0,0,9,10,11,12])
What is the most efficient way to select all values except values (in my example - 0) in some positions?
So I need to get an array:
[1,2,3,4,5,6,7,8,9,10,11,12]
I know how to skip a single nth value with a construct [::n], but is it possible to skip multiple values using the same syntax?
Thanks for the help!