allanbatista
9/5/2018 - 8:39 PM

How Compare python memory Array vs Numpy

import numpy as np
from sys import getsizeof

arr = []
for i in range(1000):
    arr.append([i * 1.0 for i in range(1000)])

np_arr = np.array(arr)

print(getsizeof(arr))
print(np_arr.nbytes)