I have a numpy array: k = np.array([100,20,25,10,1,2]) and I'm trying to use a np where as index=np.where(k<10) which gives me
index (array([4, 5]),). I'm insterested in something to give me just the index so here I'd like to have index[0]=4 not index[0]=[4 5]
I couldn't find anything here on the numpy docs.
index = np.where(k<10)toindex = np.where(k<10)[0]to get what you want.wherereturns a tuple of arrays of indices, instead of just an array of indices.