1
Hello, everybody,
I have a Python code that reads the 5040 numbers of a TXT file to perform a simulation, as shown in Figure 1. Then the code creates a B(s) function, which is used in the commands of the Figure 2 (I skipped a part of the code between Figure 1 and Figure 2). However, when I click on Run module
, Python Shell shows the error message IndexError: index 5324 is out of bounds for axis 0 with size 5040
, which is best seen in Figure 3.
I’m a beginner with Python and although I’ve encountered similar errors with Numpy’s Index, no solution worked for my code.
Can someone help me? Thank you in advance, Marcos Miotti
Figure 1 - Reading TXT File and Function B(s).
see if taking out your Dropbox file works
– user37612
No, the same error appears.
– Marcos Paulo Miotti
I’ve already solved the problem.
– Marcos Paulo Miotti
Hi @Marcospaulomiotti ! I was editing the answer and didn’t realize that you had already solved the problem :-)
– Gomiero
Milestones, avoid pasting code, listings, and errors like images: images are not text, and are only readable by people with normal vision. If you paste text, people with special needs can have the same read as audio, stackoverflow and google will be able to index your problem by Chace words in your code, and all- including users with normal vision, will be able to copy snippets of your code to a Python prompt or a text editor, to reproduce your problem and thus be able to solve it.
– jsbueno