In this example we will show how to slice the entire NumPy array in Python.
Source Code
import numpy as np
n = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
# get every other element from the entire array
print(n[::]) # default step
print(n[::3]) # specify the step
Output:
[ 1 2 3 4 5 6 7 8 9 10]
[ 1 4 7 10]