What is the the difference between the three \"all\" methods in Python/NumPy? What is the reason for the performance difference? Is it true that ndarray.all() is always the fast
I'll take a swing at this
np.all
is a generic function which will work with different data types, under the hood this probably looks for ndarray.all
which is why it's slightly slower.
all
is a python bulit-in function see https://docs.python.org/2/library/functions.html#all.
ndarray.all
is method of the 'numpy.ndarray' object, calling this directly may be faster.