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
Boxiang Sun
cython
Commits
ad2527e6
Commit
ad2527e6
authored
Jun 26, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved an example to the examples directory.
parent
084a25f5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
docs/examples/userguide/memoryviews/slicing.pyx
docs/examples/userguide/memoryviews/slicing.pyx
+10
-0
docs/src/userguide/memoryviews.rst
docs/src/userguide/memoryviews.rst
+2
-7
No files found.
docs/examples/userguide/memoryviews/slicing.pyx
0 → 100644
View file @
ad2527e6
import
numpy
as
np
exporting_object
=
np
.
empty
((
15
,
10
,
20
),
dtype
=
np
.
intc
)
cdef
int
[:,
:,
:]
my_view
=
exporting_object
# These are all equivalent
my_view
[
10
]
my_view
[
10
,
:,
:]
my_view
[
10
,
...]
docs/src/userguide/memoryviews.rst
View file @
ad2527e6
...
...
@@ -112,14 +112,9 @@ adds 1 to each item::
Indexing and slicing can be done with or without the GIL. It basically works
like NumPy. If indices are specified for every dimension you will get an element
of the base type (e.g. `int`). Otherwise, you will get a new view. An Ellipsis
means you get consecutive slices for every unspecified dimension:
:
means you get consecutive slices for every unspecified dimension:
cdef int[:, :, :] my_view = exporting_object
# These are all equivalent
my_view[10]
my_view[10, :, :]
my_view[10, ...]
.. literalinclude:: ../../examples/userguide/memoryviews/slicing.pyx
Copying
...
...
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