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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
1dd339cb
Commit
1dd339cb
authored
Jun 26, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the transpose code snippet to the examples directory.
parent
084a25f5
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 @
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
docs/src/userguide/memoryviews.rst
View file @
1dd339cb
...
...
@@ -146,10 +146,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