Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bio-IT Workshops
Intermediate Python
Commits
f47c7dab
Verified
Commit
f47c7dab
authored
Jul 08, 2020
by
Renato Alves
🌱
Browse files
Add alternative example using Python's negative slicing
parent
7337b077
Changes
1
Hide whitespace changes
Inline
Side-by-side
_episodes/02-data.md
View file @
f47c7dab
...
...
@@ -258,6 +258,9 @@ array([[156, 173, 156, 161],
> > ~~~
> > border_size = 500
> > new_image = raw[border_size:raw.shape[0]-border_size, border_size:raw.shape[1]-border_size]
> > # We could have also written
> > # new_image = raw[border_size:-border_size, border_size:-border_size]
> > # making use of python negative indexing - i.e. from the end of the array - works on lists too
> > plt.imshow(new_image, cmap='gray')
> > ~~~
> > {: .language-python }
...
...
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