I\'m using python to analyse some large files and I\'m running into memory issues, so I\'ve been using sys.getsizeof() to try and keep track of the usage, but it\'s behaviou
The field nbytes will give you the size in bytes of all the elements of the array in a numpy.array:
numpy.array
size_in_bytes = my_numpy_array.nbytes
Notice that this does not measures "non-element attributes of the array object" so the actual size in bytes can be a few bytes larger than this.