Hi Everyone,
I am using the research environment to make a dataframe and have run into a slight issue. Specifically, I have used the folling code to try and add fundamental data values, but I am confused why the corresponding fundamnetal data values are not being inputted. Does anyone have an explanation for this issue? Thanks.
Shile Wen
Â
Hi Ari,
Please attach a backtest that contains the full notebook to help us identify the issue.
Best,
Shile Wen
Ari Sondhi
Go to the file that says TEST.ipynb. The issue is within the 8th cell. Thanks.
Shile Wen
Hi Ari,
The reason they are NaN is because we are trying to stuff pandas DataFrame objects into a cell. To address this, we need to index the DataFrame to get a singular value. Furthermore, we want to increase the days for fundamental data to reduce the chances of getting an empty DataFrame, and if we do, we need to make sure we don't try to index it. I've shown this in the attached backtest.
Best,
Shile Wen
Ari Sondhi
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!