Verified Commit f47c7dab authored by Renato Alves's avatar Renato Alves 🌱
Browse files

Add alternative example using Python's negative slicing

parent 7337b077
......@@ -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 }
......
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