Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why does fetcher not read saved data to dropbox from quandl?

Hi,

If I save a quandl csv file to dropbox and then call the fetcher it throws an error. I have no idea why?

  fetch_csv('http://www.quandl.com/api/v1/datasets/EUREX/FDAXH2014.csv?trim_start=2013-09-09',  
        date_column='Date',  
        symbol='fdax',  
        pre_func=set_headers,  
        post_func=rename_col,  
        date_format='%Y-%m-%d')  

    fetch_csv(  
        'https://www.dropbox.com/s/xxxxxx/FDAXH2014.csv',  
        date_column='Date',  
        symbol='fdax',  
        pre_func=set_headers,  
        post_func=rename_col,  
        date_format='%Y-%m-%d' )  

Error:

Something went wrong on our end. Sorry for the inconvenience.  
CParserError: Error tokenizing data. C error: Expected 1 fields in line 3, saw 2  
File test_algorithm_sycheck.py:42, in initialize  
File algoproxy.py:1477, in fetch_csv  
File requests_csv.py:364, in __init__  
File requests_csv.py:247, in load_df  
File requests_csv.py:370, in fetch_data  
File parsers.py:400, in parser_f  
File parsers.py:205, in _read  
File parsers.py:608, in read  
File parsers.py:1028, in read  
File parser.pyx:706, in pandas.parser.TextReader.read (pandas/parser.c:6745)  
File parser.pyx:728, in pandas.parser.TextReader._read_low_memory (pandas/parser.c:6964)  
File parser.pyx:781, in pandas.parser.TextReader._read_rows (pandas/parser.c:7568)  
File parser.pyx:768, in pandas.parser.TextReader._tokenize_rows (pandas/parser.c:7451)  
File parser.pyx:1661, in pandas.parser.raise_parser_error (pandas/parser.c:18744)  
2 responses

I guess something wrong with pandas itself...next code does not run either..

from pandas import read_csv  
from urllib import urlopen  
page = urlopen("dropbox url of above fails, quandl works")  
df = read_csv(page) #how to step into io.parser?  
print df  
print df['Date']  

You need to use the public Dropbox URL to fetch the file into your algo. The general format of the URL looks like: https://dl.dropboxusercontent.com/u/1234567/filename.csv

Take a look here for more details. Hope that helps!

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.