Back to Community
fetch a multiple columns csv error

Hi,
I'm trying to fetch a csv which has multiple columns( one for date, nine for nine different stock prices).

    fetch_csv(url,  
              date_column = 'Date',  
              date_format = '%y-%m-%d',  
              symbol =['A','B','C','D','E','F','G','H','I'])  

But it generates "Length of values does not match length of index" error.
How should I change my code to fetch multiple columns?

Thanks,

1 response

Hi David,

I would re-arrange the CSV file to look like this:
symbol,price,date
A,pricevalue,datevalue
B,pricevalue,datevalue
C,pricevalue,datevalue
...

and remove the "symbol =['A','B','C','D','E','F','G','H','I']" in the fetch_csv function.

HTH