title: How to know bytes size of python object like arrays and dictionaries? - The simple way
body: <p>I was looking for a easy way to know bytes size of arrays and dictionaries object, like </p>
  
  <pre><code>[ [1,2,3], [4,5,6] ] or { 1:{2:2} }
  </code></pre>
  
  <p>Many topics say to use pylab, for example:</p>
  
  <pre><code>from pylab import *
  
  A = array( [ [1,2,3], [4,5,6] ] )
  A.nbytes
  24
  </code></pre>
  
  <p>But, what about dictionaries?
  I saw lot of answers proposing to use pysize or heapy. An easy answer is given by Torsten Marek in this link: <a href="https://stackoverflow.com/questions/110259/python-memory-profiler">Which Python memory profiler is recommended?</a>, but I haven't a clear interpretation about the output because the number of bytes didn't match.</p>
  
  <p>Pysize seems to be more complicated and I haven't a clear idea about how to use it yet.</p>
  
  <p>Given the simplicity of size calculation that I want to perform (no classes nor complex structures), any idea about a easy way to get a approximate estimation of memory usage of this kind of objects?</p>
  
  <p>Kind regards.</p>