Assume you have a numpy array as array([[5],[1,2],[5,6,7],[5],[5]]).
Is there a function, such as np.where, that can be used to return all row indices where [5] is the row value? For example, in the array above, the returned values should be [0, 3, 4] indicating the [5] row numbers.
Please note that each row in the array can differ in length.
Thanks folks, you all deserve best answer, but i gave the green mark to the first one :)
[5]'s are[?]indicating missing data, which I want them removed from the dataset. One way is to initialize another array that takes the row indices where[?]is not present. The reason why the structure is erratic is because some samples correspond to more than one class. Sorry about the Machine learning jargon, but thats the only way i can think of for explaining the importance of such arrays.