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

Pandas problem #28

Closed
peter-zigo-nxp opened this issue Oct 17, 2018 · 1 comment
Closed

Pandas problem #28

peter-zigo-nxp opened this issue Oct 17, 2018 · 1 comment

Comments

@peter-zigo-nxp
Copy link

Hi I have problem to generate average_true_range.

It looks that there is problem in pandas.

I using python 3.6, pandas 0.23.4

(ta_2) c:\repos\ta_test\ta-master\examples_to_use>python all_features_example.py
Index(['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume_BTC',
'Volume_Currency', 'Weighted_Price'],
dtype='object')
Traceback (most recent call last):
File "all_features_example.py", line 17, in
fillna=True)
File "C:\Users\nxa18933\AppData\Local\Continuum\anaconda3\envs\ta_2\lib\site-packages\ta\wrapper.py", line 190, in add_all_ta_features
df = add_volatility_ta(df, high, low, close, fillna=fillna)
File "C:\Users\nxa18933\AppData\Local\Continuum\anaconda3\envs\ta_2\lib\site-packages\ta\wrapper.py", line 54, in add_volatility_ta
n=14, fillna=fillna)
File "C:\Users\nxa18933\AppData\Local\Continuum\anaconda3\envs\ta_2\lib\site-packages\ta\volatility.py", line 44, in average_true_range
atr[i] = (atr[i-1] * (n-1) + tr[i]) / n
File "C:\Users\nxa18933\AppData\Local\Continuum\anaconda3\envs\ta_2\lib\site-packages\pandas\core\series.py", line 767, in getitem
result = self.index.get_value(self, key)
File "C:\Users\nxa18933\AppData\Local\Continuum\anaconda3\envs\ta_2\lib\site-packages\pandas\core\indexes\base.py", line 3118, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas_libs\index.pyx", line 106, in pandas._libs.index.IndexEngine.get_value
File "pandas_libs\index.pyx", line 114, in pandas._libs.index.IndexEngine.get_value
File "pandas_libs\index.pyx", line 162, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 958, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 964, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 3

bukosabino added a commit that referenced this issue Oct 17, 2018
@bukosabino bukosabino mentioned this issue Oct 17, 2018
@bukosabino
Copy link
Owner

bukosabino commented Oct 17, 2018

It was a bug in this library!

It is fixed in new version 0.3.5:

pip install ta==0.3.5

Thank you!

bukosabino added a commit that referenced this issue Oct 27, 2018
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

2 participants