How can I get an array of alternating values in python?
Asked 2011-08-22T23:22:55.893
24
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). Thoughts?