Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError : "list index out of range" ,coming on running "triple_moving_average.py" code #254

Open
20JE0187 opened this issue Dec 26, 2021 · 2 comments

Comments

@20JE0187
Copy link

indexerror

When I run the python code "triple_moving_average.py" , I was getting the above error.

After working and analysing the issue, I got that the path given ,for loading the data in the rd.load_data(), was wrong because
the length of the sys.argv is equal to 1 and thus we cannot access sys.argv[1] ,thus giving index error.

triple

In the "triple_moving_average.py" , when I commented the whole code after if __name__ == "__main__": (as you can see in the above figure), the code runs fine. Below is the output

code

So I think the whole code after if __name__ == "__main__": can be commented to avoid any IndexError.

@nighteous
Copy link

kinda hacky but what happens if you change sys.argv from 1 to 2? (while keeping the rest of the code same)

@poojatalele
Copy link

I would like to work on this, kindly assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants