Planet Python

Real Python: NumPy's max() and maximum(): Find Extreme Values in Arrays

NumPy's max() function is a key tool for data analysis in Python, efficiently finding maximum values within an array. This tutorial covers using max() and maximum(), handling missing values, and advanced features like broadcasting. NumPy's max() function finds the maximum value within a single array, working with both one-dimensional and multi-dimensional arrays. Conversely, np.maximum() compares two arrays element-wise to find the maximum values. np.amax() and max() are equivalent in NumPy. np.nanmax() can be used to find the maximum value in an array while ignoring nan values. NumPy is a Python library that enables fast, parallelized computations on multidimensional arrays of numbers. The NumPy library is built around the np.ndarray class and a set of methods and functions that leverage Python syntax. NumPy arrays are more efficient than lists and are supported by a huge library of methods and functions. This tutorial provides an introduction to NumPy and its capabilities, including creating and using NumPy arrays.
favicon
realpython.com
realpython.com
Create attached notes ...