As people have stated in the comments of your question, they are referencing two different functions.
max(my_array)
is a built in Python function available to any sequence data in python.
Whereas, my_array.max()
is referencing a function within the object. In this case my_array is from the Numpy array class. Numpy does not recognize the list data type for this function. However, this method will provide a speed improvement over the max(my_array)
whenever you are using numpy data sequences.
As a rule of thumb if the variable has a variable.someMethod()
the function is a method and is specific to the class of object. If the function is called as function(variable)
then the function is either a part of the python distribution or the file/class you are working with.