title: 2D MemoryView from dynamic arrays in Cython
body: <p>I am aware of this <a href="https://stackoverflow.com/questions/53902999/cython-memoryview-of-a-dynamic-2d-carray">question</a>, but I was looking for a simpler way to generate 2d memoryviews from C arrays. Since I am a C and Cython noobie, could someone please explain why something like</p>
  
  <pre><code>cdef int[:, :] get_zeros(int d):
      # get 2-row array of zeros with d as second dimension
      cdef int i
      cdef int *arr = &lt;int *&gt; malloc(sizeof(int) * d)
      for i in range(d):
          arr[i] = 0
      cdef int[:, :] arr_view
      arr_view[0, :] = &lt;int[:d]&gt;arr
      arr_view[1, :] = &lt;int[:d]&gt;arr
      return arr_view
  </code></pre>
  
  <p>won't work? </p>
  
  <p>When compiling it I get <code>Cannot assign type 'int[::1]' to 'int'</code> as error. Does this mean, that the 2d memview is collapsed by the first assign statement to 1d or is it because memoryviews need contiguous blocks etc.? </p>