Hi All,
I am encountering the following error with the default research notebook at line h1.loc["SPY"]["close"].plot():
AttributeError: '0, Culture=neutral, PublicKeyToken=null]]' object has no attribute 'loc'
Why is that happen and how to resolve it ? Thanks very much! Kevin
Gurumeher Sawhney
The reason why the error occurred is that when calling qb.History() there were no assets specified; the only parameters were the number of bars and the resolution.
The line should have been: h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily)
Since qb.Securities.Keys is called, all the securities added will be requested in this line.
Kevin Yuan
Thanks Guru, that error was gone.
However, a new warning pop out:
--------
/opt/miniconda3/lib/python3.6/site-packages/ipykernel_launcher.py:2: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version of pandas will change to not sort by default. To accept the future behavior, pass 'sort=False'. To retain the current behavior and silence the warning, pass 'sort=True'. -------- Does this warning impact the correctness of the result ? Thanks.Kevin Yuan
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!