0

I did not understand the message sent by compiler. Can someone help me?

Traceback (most recent call last):
  File "C:/Users/edboa_000/PycharmProjects/RESULTADOS_FINAIS 3/ggcc1/quadrante_aplicacao_forca9.py", line 13, in <module>
    matriz1[i-11][j] = posicao[j]
TypeError: 'int' object does not support item assignment

My code:

matriz1=((30,2))
for i in range(11,41):
    graof = np.genfromtxt('DMconf0%d.dat'%i,skip_header=10254, usecols=(0))
    grao = graof.astype('int')
    posicao = np.genfromtxt('DMconf0%d.dat'%i,skip_header=grao, usecols=(0,1), max_rows=1)
    for j in range(2):
         matriz1[i-11][j] = posicao[j] #line 13

print(matriz1)
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
Eduardo
  • 1
  • 1

0 Answers0