I am trying to append a number to a numpy array. This seems like a simple task (and I have seen and tried this), but somehow they are not being appended.
newlist = np.array([])
for i in range(15, 15+number):
number = myList[i][1];
np.append(newlist,[number])
print newlist
I believe it might have to do with the fact that myList is a normal list that contains both strings and numbers. Should I cast it to a number first or something? myList:
[['started recording', '38:20.4', '\r\n'], ['stopped recording', '42:46.1', '\r\n'], ['participant number', '41', '\r\n'],...
newlist = np.append(newlist,[number])numpy.append. In particular, see the "Returns" section, which notes thatappenddoes not work in-place.arrand appendvaluesto the end.", or something like that.