Working with vector elements
Working with vector elements is the same as with list elements, you can access elements by their index, and also make slices.
Example
1
2
3
4
5
6
7
|
import numpy as np
V = np.array((1,2,3,4))
print(V[0]) # 1
print(V[-1]) # 4
print(V[1:-2]) # [2]
print(V[::2]) # [1 3]
|