In this question Why NumPy instead of Python lists? [closed] every one seems to agree than numpy array are a more compact structure. I try to replicate this and I found than is only true when the list become huge. I am on python3.5 ubuntu 12.04
import sys
from numpy getsizeof
a = [1.0,2.0,3.0,4.0]
print(getsizeof(a)) # 96
print(getsizeof(numpy.array(a))) # 128
a = list(range(1000))
print(getsizeof(a)) # 9112
print(getsizeof(numpy.array(a))) # 8096
Could someone explain me why?