Commit 3198026c authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2432 from gabrieldemarmiesse/test_memoryviews_5

Added tests for "typed memoryviews" part 5
parents 86d0c959 1dd339cb
import numpy as np
array = np.arange(20, dtype=np.intc).reshape((2, 10))
cdef int[:, ::1] c_contig = array
cdef int[::1, :] f_contig = c_contig.T
...@@ -130,10 +130,9 @@ Transposing ...@@ -130,10 +130,9 @@ Transposing
----------- -----------
In most cases (see below), the memoryview can be transposed in the same way that In most cases (see below), the memoryview can be transposed in the same way that
NumPy slices can be transposed:: NumPy slices can be transposed:
cdef int[:, ::1] c_contig = ... .. literalinclude:: ../../examples/userguide/memoryviews/transpose.pyx
cdef int[::1, :] f_contig = c_contig.T
This gives a new, transposed, view on the data. This gives a new, transposed, view on the data.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment