I have an array as depicted below. How can I remove the last two elements, e.g. 3,4,7,8,11,12,15,16,19 and 20 ?
import numpy as np
vector = np.arange(1,21)
vector2 = np.array_split(vector,5)
print(vector2)
[array([1, 2, 3, 4]),
array([5, 6, 7, 8]),
array([ 9, 10, 11, 12]),
array([13, 14, 15, 16]),
array([17, 18, 19, 20])]
Would indexing directly be the only method or is there perhaps a better approach to doing this?