numpy.extract()

numpy.extract

numpy.extract(condition, arr) [source]

Return the elements of an array that satisfy some condition.

This is equivalent to np.compress(ravel(condition), ravel(arr)). If condition is boolean np.extract is equivalent to arr[condition].

Note that place does the exact opposite of extract.

登录查看完整内容