Simple question here:
I\'m trying to get an array that alternates values (1, -1, 1, -1.....) for a given length. np.repeat just gives me (1, 1, 1, 1,-1, -1,-1, -1
Use numpy.tile!
numpy.tile
import numpy a = numpy.tile([1,-1], 15)