rougier / numpy-100

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

Alternative solution to q4, Use Z.nbytes to find the memory size directly. #202

Closed DRaz1r closed 4 months ago

DRaz1r commented 1 year ago

Scope

100_Numpy_exercises_with_hints_with_solutions.md 100_Numpy_exercises_with_solutions.md

Description

This pull request gives an alternative solution to q4. Z.nbytes is a built-in attribute of the NumPy array object, specifically designed to return the total number of bytes. It provides a concise and straightforward way to obtain the result.

rougier commented 1 year ago

Thanks. All the md and notebook files are generated from the ktx files in sources. Could you make modify your patch?