I have a loop which generates an array from a text file. Every time it passes through the loop I want it to add the new array to the old one but I'm not sure how to do this. For example:
loop=np.arange(1,50)
for arg in loop:
str(arg)
a=np.genfromtxt('dir/'+arg+'.txt').T[0]
total=a+a+a #I know this line is wrong
How do I get total to be the total of every a over the array loop.