The description of an argument of Quantopian's fetch_csv() function is the following:

A well-formed http or https url pointing to a CSV file that has a header, a date column, and a symbol column (symbol column required to match data to securities).

How can my CSV possibly have BOTH a date column and a symbol column? In my CSV, (created using pandas.DataFrame's to_csv() function), the dates occupy a column, but the symbols constitute a row, and it is blatantly obvious that if the dates are in a column, the symbols cannot also be. Can anyone explain this to me? Thank you.


It might be allowing you to upload, via CSV, values for multiple dates and multiple securities, all in one go.

Think about how you would format the columns if you had 4 dates of values for stockA and 10 dates of values for stockB

| improve this answer | |

for example:

your file:

#N/A,     SX5E
20170519, 3590
20170518, 3585
20170517, 3586
20170516, 3583
20170515, 3582

Now say we have SX5E and also N225 - they have different holidays, so you might (in your format) have something like this:

#N/A,     SX5E, N225
20170519, 3590, 19600
20170518, 3585, 19590
20170517, 3586, #N/A
20170516, 3583, 19596
20170515, 3582, 19589

the format they're asking for sounds more like this:

Date, Ticker, Value
20170519, SX5E, 3590
20170518, SX5E, 3585
20170517, SX5E, 3586
20170516, SX5E, 3583
20170515, SX5E, 3582
20170519, N225, 19600
20170518, N225, 19590
20170516, N225, 19596
20170515, N225, 19589
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.