title: How to expose a numpy array from c array in cython?
body: <pre><code>cpdef myf():
      # pd has to be a c array.
      # Because it will then be consumed by some c function.
      cdef double pd[8000]
      # Do something with pd
      ...
      # Get a memoryview.
      cdef double[:] pd_view = pd 
      # Coercion the memoryview to numpy array. Not working.
      ret = np.asarray(pd)
      return ret
  </code></pre>
  
  <p>I would like it to return a numpy array. How can I do it?</p>
  
  <p>For the moment I have to do</p>
  
  <pre><code>pd_np = np.zeros(8000, dtype=np.double)
  cdef int i
  for i in range(8000):
      pd_np[i] = pd[i]
  </code></pre>