Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
3198026c
Commit
3198026c
authored
Jul 06, 2018
by
scoder
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2432 from gabrieldemarmiesse/test_memoryviews_5
Added tests for "typed memoryviews" part 5
parents
86d0c959
1dd339cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
docs/examples/userguide/memoryviews/transpose.pyx
docs/examples/userguide/memoryviews/transpose.pyx
+6
-0
docs/src/userguide/memoryviews.rst
docs/src/userguide/memoryviews.rst
+2
-3
No files found.
docs/examples/userguide/memoryviews/transpose.pyx
0 → 100644
View file @
3198026c
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
docs/src/userguide/memoryviews.rst
View file @
3198026c
...
...
@@ -130,10 +130,9 @@ Transposing
-----------
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 = ...
cdef int[::1, :] f_contig = c_contig.T
.. literalinclude:: ../../examples/userguide/memoryviews/transpose.pyx
This gives a new, transposed, view on the data.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment