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.

Unexpected behavior when computing all pandas_ta indicators on a given dataset

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Dec 6, 2020

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

0reactions
twopirllccommented, Dec 2, 2020

Hello @Pap8,

I assume this has solved your issue. If not reopen when ready.

Thanks, KJ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Technical Analysis Library in Python 0.1.4 documentation
It is a Technical Analysis library useful to do feature engineering from financial time series datasets (Open, Close, High, Low, Volume).
Read more >
Anomaly Detection : A Survey - cucis
Figure 1 illustrates anomalies in a simple 2-dimensional data set. ... well as representative of all types of behaviors, is often prohibitively expensive....
Read more >
How to Create an ARIMA Model for Time Series Forecasting in ...
We can split the training dataset into train and test sets, use the train set to fit the model, and generate a prediction...
Read more >
What is Text Analysis? A Beginner's Guide - MonkeyLearn
Text analysis (TA) is a machine learning technique used to automatically extract valuable insights from unstructured text data. Companies use text analysis ...
Read more >
TA-Lib - PyPI
In addition, this project also supports the use of the Polars and Pandas libraries. Installation. You can install from PyPI: $ python3 -m...
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