A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/machine-learning/numpy-ndarray-itemsize-method-python/ below:

numpy.ndarray.itemsize() method | Python - GeeksforGeeks

numpy.ndarray.itemsize() method | Python

Last Updated : 26 Mar, 2020

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4