what does the max function do
>>> import numpy >>> numpy.max # Notice it says 'amax' in the output <function amax at 0x0228B5D0> >>> numpy.max is numpy.amax True >>> Or, more specifically, max is an alias for the amax function. The purpose of this function is listed in the docs link you gave, but it seems that it is mainly used to find the maximum value inside a numpy.array regardless of how many nested levels it has. You can mimic this behavior with a simple function to flatten a list: