I have a list of 41 data from a functioned I defined, but I only want to access the first 40 of them. So, the index positions I am looking for are from 0 - 39
forecast_price(10)[:len(forecast_price(10)) - 1]
I also made it a variable for easier reference further on in my codes:
forecast_w10 = forecast_price(10)[:len(forecast_price(10)) - 1]
However, when I try printing the length of data in the variable, I still get 41. I feel like the mistake is right under my nose but can't seem to figure it out. What am I doing wrong?
In[46]: print(len(forecast_w10))
Out[46]: 41