Let's say
t1=loadtxt("t\\1.txt")
t2=loadtxt("t\\2.txt")
Assume inside 1.txt is
1 2 3
4 5 6
Assume also inside 2.txt is
1 2 3
4 5 6
#
t1[0,0]=1
t1[0,1]=2
t1[0,2]=3
t2[0,0]=1
t2[0,1]=2
t2[0,2]=3
st=0
for i in range(2):
for j in range(3):
a='t'+str(i+1)
st=st+a
I got "TypeError: string indices must be integers"
What I want this piece of code to do is st=t1[0,0]+t1[0,1]+t1[0,2]+t2[0,0]+t2[0,1]+t2[0,2]
Then how to fulfill this goal? How to represent the array name with regular numbers in for loop? Instead of summing each value one by one.