I'm trying add some numpy arrays into a single array, my code looks like:
m1=symarray('', 2)
for i in range(0,len(countersum)):
if countersum[i]==1:
m1.append(gmcounter[i])
This give error
AttributeError: 'numpy.ndarray' object has no attribute 'append'
I have also tried changing append to vstack but it gives the same error
If I modify the last line to have m1=gcounter[i] it works but only selects the first element of gcounter meeting the condition, and disregards everything afterwards.
Does anyone know how I can resolve this?
I have seen the thread Append a NumPy array to a NumPy array but I am unable to declare what I need to append as a numpy array beforehand.
Many thanks