Add single element to array in numpy

append() creates a new array which can be the old array with the appended element.

I think it’s more normal to use the proper method for adding an element:

a = numpy.append(a, a[0])

Leave a Comment