title: Numpy | hex(id()) vs. .data
body: <p>I have two questions that I have been dealing with for two days:</p>
  <p>if I want to determine for a numpy object adarray the memory address of the object and the elements with the numpy method .array and once with the normal python functions hex(id()) I get different addresses.
  with hex(id()) it gets really weird. sometimes the elements get the same addresses sometimes different ones.</p>
  <pre><code>import numpy as np
  y = np.array([0,1,2,3])
  print(y.data)
  print(y[0].data)
  print(y[1].data)
  print(y[2].data)
  print(y[3].data)
  print(hex(id(y[0])))
  print(hex(id(y[1])))
  print(hex(id(y[2])))
  print(hex(id(y[3])))
  </code></pre>
  <p>the results are:</p>
  <pre><code>&lt;memory at 0x7f9aaa22d870&gt;
  &lt;memory at 0x7f9aaa1bd940&gt;
  &lt;memory at 0x7f9aaa1bd940&gt;
  &lt;memory at 0x7f9aaa1bd940&gt;
  &lt;memory at 0x7f9aaa1bd940&gt;
  0x7f9aaa31e030
  
  with hex((id))
  0x7f9aaa1c0750
  0x7f9aaa1c0730
  0x7f9aaa1c0130
  0x7f9aaa1c0750
  </code></pre>