numpy.amin() in Python Last Updated : 28 Apr, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The numpy.amin() function returns minimum of an array or minimum along axis(if mentioned). Syntax : numpy.amin(arr, axis = None, out = None, keepdims = <class numpy._globals._NoValue>) Parameters : arr : [array_like]input dataaxis : [int or tuples of int]axis along which we want the min value. Otherwise, it will consider arr to be flattened.out : [ndarray, optional]Alternative output array in which to place the resultkeepdims : [boolean, optional]If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the all method of sub-classes of ndarray, however any non-default value will be. If the sub-classes sum method does not implement keepdims any exceptions will be raised. Return : Minimum of array - arr[ndarray or scalar], scalar if axis is None; the result is an array of dimension a.ndim - 1, if axis is mentioned. Code - Python # Python Program illustrating # numpy.amin() method import numpy as geek # 1D array arr = geek.arange(8) print("arr : ", arr) print("Min of arr : ", geek.amin(arr)) # 2D array arr = geek.arange(10).reshape(2, 5) print("\narr : ", arr) # Minimum of the flattened array print("\nMin of arr, axis = None : ", geek.amin(arr)) # Minimum along the first axis # axis 0 means vertical print("Min of arr, axis = 0 : ", geek.amin(arr, axis = 0)) # Minimum along the second axis # axis 1 means horizontal print("Min of arr, axis = 1 : ", geek.amin(arr, axis = 1)) Output - arr : [0 1 2 3 4 5 6 7] Min of arr : 0 arr : [[0 1 2 3 4] [5 6 7 8 9]] Min of arr, axis = None : 0 Min of arr, axis = 0 : [0 1 2 3 4] Min of arr, axis = 1 : [0 5] References - https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.amin.html#numpy.amin Note - These codes won't run on online IDE's. So please, run them on your systems to explore the working. Comment More infoAdvertise with us Next Article numpy.amin() in Python M Mohit Gupta Improve Article Tags : Python Practice Tags : python Similar Reads numpy.alen() in Python numpy.alen() function is used to return the length of the first dimension of the input array. Syntax : numpy.alen(arr) Parameters : arr : [array_like] Input array. Return : [int]Length of the first dimension of arr. Code #1 : Python3 # Python program explaining # alen() function import numpy as geek 1 min read numpy.find() in Python numpy.core.defchararray.find(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, optional] Range to search in. Returns : An integer array wi 1 min read numpy.isnan() in Python The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax :Â numpy.isnan(array [, out]) Parameters :Â array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed wit 2 min read numpy.index() in Python numpy.core.defchararray.index(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range But if substring is not found, it raises ValueError. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, option 1 min read numpy.arange() in Python numpy.arange() function creates an array of evenly spaced values within a given interval. It is similar to Python's built-in range() function but returns a NumPy array instead of a list. Let's understand with a simple example:Pythonimport numpy as np #create an array arr= np.arange(5 , 10) print(arr 2 min read Like