joosthoeks / jhTAlib

Technical Analysis Library Time-Series
https://joosthoeks.github.io/jhTAlib/
GNU General Public License v3.0
152 stars 44 forks source link

VWAP issue #13

Closed frexum closed 4 years ago

frexum commented 4 years ago

I have a data frame with all the requirements (Open, High, Low, Close) but end up getting this error and am stuck.

`Traceback (most recent call last): File "C:/Users/XXXX", line 55, in f['VWAP'] = jhtalib.VWAP(f,open='Open', high='High', low='Low', close='Close', volume='Volume') File "C:\Users\Marc\tickles\venv\lib\site-packages\jhtalib\volume_indicators\volume_indicators.py", line 133, in VWAP o = df[open][i] File "C:\Users\Marc\tickles\venv\lib\site-packages\pandas\core\series.py", line 1071, in getitem result = self.index.get_value(self, key) File "C:\Users\Marc\tickles\venv\lib\site-packages\pandas\core\indexes\base.py", line 4730, in get_value return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None)) File "pandas/_libs/index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value File "pandas/_libs/index.pyx", line 88, in pandas._libs.index.IndexEngine.get_value File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 992, in pandas._libs.hashtable.Int64HashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 998, in pandas._libs.hashtable.Int64HashTable.get_item KeyError: 0

Process finished with exit code 1 `

Was just wondering if you have any insights into what I'm doing wrong.

Thank you

joosthoeks commented 4 years ago

Hello,

Can you post your data frame and code what's generate this error?

frexum commented 4 years ago

I apologize, the data frame was not loading correctly and when changed the code worked perfectly. Thank you for your prompt response.