The memory size

Report a typo

We mentioned how to find the number of elements in the array. There is another attribute of the array, ndarray.itemsize, which will return the length of one array element in bytes.

Complete the memory_size function which accepts a NumPy array as the argument and returns the memory size of an array (in bytes).

Write a program in Python 3
import numpy as np

def memory_size(arr):
...
___

Create a free account to access the full topic