Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4 memory size of any array #201

Open
wangyi041228 opened this issue Jul 6, 2023 · 1 comment
Open

#4 memory size of any array #201

wangyi041228 opened this issue Jul 6, 2023 · 1 comment

Comments

@wangyi041228
Copy link

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

@rougier
Copy link
Owner

rougier commented Jul 11, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants