Here is a section (a large section) of my code. http://pastebin.com/KCZNkYNB
What i have happening, by design, is to iterate through this sequence until the distance that i am calculating is minimized by 1cm. I don’t want to move on to my next epoch until that, which is why i thought i should use .insert for my lists. I need to overwrite the data at the indices it’s currently at.
The error i am getting is:
Traceback (most recent call last):
File "receiver2.py", line 342, in <module>
main()
File "receiver2.py", line 244, in main
N.insert(k, ( dec.sqrt( (dec(satellite_output.x[k]) - dec(x_veh_coords[epoch]))**2 + (dec(satellite_output.y[k]) - d
ec(y_veh_coords[epoch]))**2 + (dec(satellite_output.z[k]) - dec(z_veh_coords[epoch]))**2 ) ) )
IndexError: list index out of range
This error corresponds with line number 54 in the pastebin file.
What I don’t understand is how an index is out of range when you’re insert.
Full pastebin output: http://pastebin.com/qKhRjn2Q
You will see at the bottom of that output that the last “k” indice was 7, then it reached epoch 1, and incremented to indice 8 but then crapped out with the index out of range. I’m extremely confused as to why that happens. I assure you all the data does exists that is trying to be inserted as if i were to commend out the .insert portion and uncomment the .append, it works fine. Unfortunately, i just realized that append is “hiding” the data i need in order to compute my jacobian correctly.
I hope i’ve given enough information. Thanks for any help you can offer!
You have six index operations in the error line (e.g.
satellite_output.x[k]); one of those is probably causing the fault, not the insert operation.The error message is less helpful than it might be.