Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
fetch_csv on forex data file returns parsing error

Just copied sample fetch_csv example and modified to import 1 min forex data but build algorithm fails.

https://www.quantopian.com/algorithms/5162617f7eee96386f00002e

3 responses

This is runtime error. Looks like datetime parsing is failing. But i have passed proper date_format. What could be the issue ?

CParserError: Error tokenizing data. C error: Expected 1 fields in line 9, saw 51
File testalgorithm_sycheck.py:16, in initialize
File algoproxy.py:882, in fetch_csv
File requests_csv.py:168, in __init
_
File requests_csv.py:203, in load_df
File requests_csv.py:199, in fetch_data
File parsers.py:399, in parser_f
File parsers.py:215, in _read
File parsers.py:631, in read
File parsers.py:954, in read
File parser.pyx:644, in pandas._parser.TextReader.read (pandas/src/parser.c:5925)
File parser.pyx:666, in pandas._parser.TextReader._read_low_memory (pandas/src/parser.c:6145)
File parser.pyx:719, in pandas._parser.TextReader._read_rows (pandas/src/parser.c:6750)
File parser.pyx:706, in pandas._parser.TextReader._tokenize_rows (pandas/src/parser.c:6634)
File parser.pyx:1572, in pandas._parser.raise_parser_error (pandas/src/parser.c:17055)

Hi,

That is an error in the parsing of the url response as csv. Usually this error means the document coming back from your url is not actually csv, but some kind of html wrapper/display for the csv.

thanks,
fawce

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.

Thanks John.