summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/memoryviews/copy.pyx
blob: 9f000a3b431070fcce245c43cd83dbd2865a2fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import numpy as np

cdef int[:, :, :] to_view, from_view
to_view = np.empty((20, 15, 30), dtype=np.intc)
from_view = np.ones((20, 15, 30), dtype=np.intc)

# copy the elements in from_view to to_view
to_view[...] = from_view
# or
to_view[:] = from_view
# or
to_view[:, :, :] = from_view