I try to get indices of an array using np.where and wish to concatenate the lists in such a manner that it gives me a 1D list. Is it possible?
l = np.array([10,20,14,10,23,5,10,1,2,3,10,5,6,5,10])
y= np.where(l==10)
p=np.where(l==5)
If I print y and p, they give me
(array([ 0, 3, 6, 10, 14]),)
(array([ 5, 11, 13]),)
Upon appending it results in a list of tuples. However the output I want is this:
[0,3,6,10,14,5,11,13]
whereproduces a tuple of arrays, one per dimension.