Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
fetch_csv partial information

hello experts,
I am having trouble with fetch_csv's simple example code.
The URL from which it lifts data is incomplete it seems. I have 2 months worth of data and when the length "len(data[context.stock]))"
is printed, it shows 10 every time. Also the number of bars of data displayed < N for df.head(N).
Also the 'log.info(df.head())''s actual log is inconsistently displayed. Sometimes it is logged when ''build algorithm" is executed and
next time for it to log the head, had to touch backtest dates.
Sometimes 'build algorithm' logs the info and some times dont.
And when 'run full backtest' is run, similar situation occurs. And most of the times it says "back test didnt generate any logs" with oscillating "waiting for logs" state.

New to python, so please excuse for being naive.
Please help
Thanks

3 responses

Quantopian doesn't always flush the logging window buffer at the end of each run I think, so that's why the info only prints occasionally on a short run like this. It carries over from one run to another, and prints once beyond filled with the set number of bytes assigned to the buffer.

Also, hitting this more often than not, as you alluded to in the comments:
Exception: Problem reaching http://www.nseindia.com/content/equities/scripvol/datafiles/02-11-2015-TO-31-12-2015INFYALLN.csv?dl=1
There was a runtime error on line 31.

Copying the csv file to a different server it was reliable.

Your csv data is there. The logging window is cropping the output to 10 lines for you I think. For me it is 11 (and at the end a '...' indicating that there is more beyond that). The data object can be difficult to interpret and navigate, particularly with fetcher.

You can examine data in the debugger like this:

... and these work, for example:

> data['INFY']  
    => data['INFY']: SIDData  
> data['INFY']['Close Price']  
    float: 1131.2  

Hope that helps.

Hi kumar,

I'd like to add to Gary's answer that we are aware of the logging issue you mentioned and are very close to shipping a fix for it. Sorry for the inconvenience!

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

Great, thanks!

Meantime can set a breakpoint on something that always runs like 'def handle_data' and when the debugger breaks in, just hit 'Finish backtest', in that case the logging content will always appear.