question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bt.get gives IndexError: tuple index out of range

See original GitHub issue
import bt
data = bt.get('aapl', start='2020-01-01')

Gives the following error:

`---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-12-d7d21c925953> in <module>
      1 # download data
----> 2 data = bt.get('aapl', start='2020-01-01')
      3 
      4 # calculate moving average DataFrame using pandas' rolling_mean
      5 #import pandas as pd

~/anaconda3/envs/stocks/lib/python3.8/site-packages/decorator.py in fun(*args, **kw)
    229             if not kwsyntax:
    230                 args, kw = fix(args, kw, sig)
--> 231             return caller(func, *(extras + args), **kw)
    232     fun.__name__ = func.__name__
    233     fun.__doc__ = func.__doc__

~/anaconda3/envs/stocks/lib/python3.8/site-packages/ffn/utils.py in _memoize(func, *args, **kw)
     18     # kw is not always set - check args
     19     if refresh_kw in func.__code__.co_varnames:
---> 20         if args[func.__code__.co_varnames.index(refresh_kw)]:
     21             refresh = True
     22 

IndexError: tuple index out of range
`

Using Jupyter Notebook, Python 3.8.9, bt 0.2.9, pandas 1.2.4

Any help would be appreciated.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
ch3st3rt0ncommented, May 17, 2021

I have the same issue after updating everything: bt 0.2.9 ffn 0.3.6 decorator 5.0.9

0reactions
Georgi-Petkovcommented, May 26, 2022

pip3 install decorator --upgrade

That worked for me. Thanks @O1dBoy

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexError: tuple index out of range ----- Python - Stack Overflow
It's saying that the index (position) you are accessing doesn't exist. – Ramchandra Apte. Nov 30, 2013 at 3:34. what code ...
Read more >
Python IndexError: tuple index out of range Solution
The IndexError: tuple index out of range error occurs when you try to access an item in a tuple that does not exist....
Read more >
Python Index Error: Tuple Index Out of Range - Kodeclik
Ways to fix tuple index out of range error. 1. Check the lower end of the index. 2. Check the upper end of...
Read more >
IndexError: Python tuple index out of range - ArrowHiTech
The IndexError: Python tuple index out of range error occurs when you try to access an item in a tuple that does not...
Read more >
[Solved]: Python IndexError: tuple index out of range
It means each value in a tuple is associated with index position (0 to n-1) to access that value. Where N represent the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found