Unexpected behavior when computing all pandas_ta indicators on a given dataset
See original GitHub issueDescribe the problem First of all, thank you very much for this great package! The unexpected behavior encountered is that after computing pandas_ta indicators on a pandas Dataframe with OHLCV columns and an index of date-time values, we end-up with an empty dataset (no indicators) if we try to remove all kinds of None values from the dataset.
To Reproduce
<code for loading data>
...
dataset.columns = [col.lower() for col in list(dataset.columns)]
#dataset columns here: 'open', 'high', 'low', 'close', 'volume'
#here we compute all pandas_ta indicators on the OHLCV columns
dataset.ta.strategy(verbose=1)
##Removing first 300 columns to avoid any kind of None values regards to indicators computed for long periods
dataset = dataset.iloc[300:,:]
#dropping any dataset rows that contain any kind of None value in any column
dataset.dropna(inplace=True,axis=0)
###after the above line we end up with an empty dataset..
......
<more code that is irrelevant to the issue>
Expected behavior After computing all pandas_ta indicators and also dropping the first 300 rows to account for indicators that need long periods for their first value to be computed (e.g. EMA200), the expected dataset shall not contain any kind of None values. That would leave us with all pandas-ta indicators for modelling.
Additional context pandas_ta.version = 0.2.23b python --version = Python 3.8.6 OS: Windows 10
Thank you very much for the help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Hello Kevin,
Hope you’ve been well.
Thank you very much for the code you have shared, it was really helpful for me in solving the issue. I can confirm that I don’t experience this issue anymore.
Regards, Frixos
Hello @Pap8,
I assume this has solved your issue. If not reopen when ready.
Thanks, KJ