Making an array of part of a vector in numpy

78 Views Asked by At

Is there a way to make a Python array in numpy of part of a vector? For example, say I have a vector v of length n, could I make an array of the elements v[2] to v[n-2]? I tried:

numpy.array(v[2]:v[n-2])

but this didn't work...