There is a file containing complex numbers. I manage to unpack it in numpy.array, and I want to list, because the number of numbers is initially unknown, and the array, unlike the list, needs to be dimensioned immediately. Trying to use code
data[x,y]= complex(struct.unpack('f', f.read(4))[0], struct.unpack('f', f.read(4))[0]) The code works for np.array, if I try to use with a list, I get the error "list indices must be integers, not tuple"