I need a good, quick method for finding the 10 smallest real values from a numpy array that could have arbitrarily many nan and/or inf values.
I need to identify the indices of these smallest real values, not the values themselves.
I have found the argmin and nanargmin functions from numpy. They aren't really getting the job done because I also want to specify more than 1 value, like I want the smallest 100 values, for example. Also they both return -inf values as being the smallest value when it is present in the array.
heapq.nsmallest kind of works, but it also returns nan and -inf values as smallest values. Also it doesn't give me the indices that I am looking for.
Any help here would be greatly appreciated.