numpy-100 icon indicating copy to clipboard operation
numpy-100 copied to clipboard

#4 memory size of any array

Open wangyi041228 opened this issue 1 year ago • 1 comments

The question means the total bytes consumed by the element of the array. In order to clear up the misunderstanding, it is suggested to revise the question stem.

Z.nbytes is more direct then Z.size * Z.itemsize.

BTW, 4 typos: an hint -> a hint of of -> of every combinations -> every combination a two dimensional -> a two-dimensional

References: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.nbytes.html https://docs.python.org/3/library/sys.html#sys.getsizeof

wangyi041228 avatar Jul 06 '23 06:07 wangyi041228

You're right but the question is a pretext to show size itemize. But we could also illustrate using nbytes == size*itemsize. Do you want to make a PR?

rougier avatar Jul 11 '23 18:07 rougier