rougier / numpy-100

100 numpy exercises (with solutions)
MIT License
12.17k stars 5.74k forks source link

Alternative solution to q4 #197

Closed jeremy-feng closed 1 year ago

jeremy-feng commented 1 year ago

Use Z.nbytes to find the memory size directly.

print("%d bytes" % (Z.nbytes))
rougier commented 1 year ago

Thanks. Can you make a PR (adding your line below the current one)? Also, make sure to only modify the kth files since others are generated.

jeremy-feng commented 1 year ago

Already solved in https://github.com/rougier/numpy-100/issues/157.