I have a numpy array containing:
[1, 2, 3]
I want to create an array containing:
[1, 2, 3, 1]
That is, I want to add the first element on to the end of the array.
I have tried the obvious:
np.concatenate((a, a[0]))
But I get an error saying ValueError: arrays must have same number of dimensions
I don't understand this - the arrays are both just 1d arrays.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…