numpy.ndarray.ndim() method | Python Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report numpy.ndarray.ndim() function return the number of dimensions of an array. Syntax : numpy.ndarray.ndim(arr) Parameters : arr : [array_like] Input array. If it is not already an ndarray, a conversion is attempted. Return : [int] Return the number of dimensions in arr. Code #1 : Python3 # Python program explaining # numpy.ndarray.ndim() function # importing numpy as geek import numpy as geek arr = geek.array([1, 2, 3, 4]) gfg = arr.ndim print (gfg) Output : 1 Code #2 : Python3 # Python program explaining # numpy.ndarray.ndim() function # importing numpy as geek import numpy as geek arr = [[1, 2, 3], [4, 5, 6]] gfg = geek.ndim(arr) print (gfg) Output : 2 Comment More infoAdvertise with us Next Article numpy.ndarray.ndim() method | Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy Python numpy-ndarray python Practice Tags : Machine Learningpython Similar Reads Python | Numpy numpy.ndarray.__add__() With the help of Numpy numpy.ndarray.__add__(), we can add a particular value that is provided as a parameter in the ndarray.__add__() method. Value will be added to each and every element in a numpy array. Syntax: ndarray.__add__($self, value, /) Return: self+value Example #1 : In this example we c 1 min read numpy.ndarray.itemsize() method | Python numpy.ndarray.itemsize() function return the length of one array element in bytes. Syntax : numpy.ndarray.itemsize(arr) Parameters : arr : [array_like] Input array. Return : [int] The length of one array element in bytes Code #1 : Python3 # Python program explaining # numpy.ndarray.itemsize() functi 1 min read Python | Numpy ndarray.item() With the help of numpy.ndarray.item() method, we can fetch the data elements that is found at the given index on numpy array. Remember we can give index as one dimensional parameter or can be two dimensional. Parameters: *args : Arguments (variable number and type) -> none: This argument only works 2 min read NumPy Array in Python NumPy (Numerical Python) is a powerful library for numerical computations in Python. It is commonly referred to multidimensional container that holds the same data type. It is the core data structure of the NumPy library and is optimized for numerical and scientific computation in Python. Table of C 2 min read numpy.ndarray.flat() in Python The numpy.ndarray.flat() function is used as a 1_D iterator over N-dimensional arrays. It is not a subclass of, Pythonâs built-in iterator object, otherwise it a numpy.flatiter instance. Syntax : numpy.ndarray.flat() Parameters : index : [tuple(int)] index of the values to iterate Return :  1-D i 3 min read Like