lundi 2 mars 2015

How would I transfer CSV "words" into Python as strings

So I am quite the beginner in Python, but what I'm trying to do is download each CSV file for the NYSE. In an excel file I have every symbol. The Yahoo API allows you to download the CSV file by adding the symbol to the base url. My first instinct was to use pandas, but pandas doesn't store strings.


So what I have



import urllib

strs = ["" for x in range(3297)]

// strs makes the blank string array for each symbol


//somehow I need to be able to iterate each symbol into the blank array spots

while y < 3297:

strs[y] = "symbol of each company from csv"
y = y+1

// loop for downloading each file from the link with strs[y].

while i < 3297:

N = urllib.URLopener()
N.retrieve('http://ift.tt/1oxBMJg'strs[y],'File')
i = i+1


Perhaps the solution is simpler than what I am doing.


Aucun commentaire:

Enregistrer un commentaire