numpy.ndarray.itemsize() method | Python Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report 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() function # importing numpy as geek import numpy as geek arr = geek.array([1, 2, 3, 4], dtype = geek.float64) gfg = arr.itemsize print (gfg) Output : 8 Code #2 : Python3 # Python program explaining # numpy.ndarray.itemsize() function # importing numpy as geek import numpy as geek arr = geek.array([1, 2, 3, 4], dtype = geek.complex128) gfg = arr.itemsize print (gfg) Output : 16 Comment More infoAdvertise with us Next Article numpy.ndarray.itemsize() 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 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.ndarray.ndim() method | Python 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 progr 1 min read Numpy ndarray.flatten() function in Python The flatten() function is used to convert a multi-dimensional NumPy array into a one-dimensional array. It creates a new copy of the data so that original array stays unchanged. If your array has rows and columns or even more dimensions, then flatten() line up every single value into a straight list 3 min read numpy.ndarray.resize() function - Python numpy.ndarray.resize() function change shape and size of array in-place. Syntax : numpy.ndarray.resize(new_shape, refcheck = True) Parameters : new_shape :[tuple of ints, or n ints] Shape of resized array. refcheck :[bool, optional] If False, reference count will not be checked. Default is True. Ret 1 min read Numpy ndarray.tobytes() function | Python numpy.ndarray.tobytes() function construct Python bytes containing the raw data bytes in the array. Syntax : numpy.ndarray.tobytes(order='C') Parameters : order : [{âCâ, âFâ, None}, optional] Order of the data for multidimensional arrays: C, Fortran, or the same as for the original array. Return : P 1 min read Like