[PyDelhi] how to run for loop in xlsv file

Shreya Agarwal shreya2105 at gmail.com
Tue Dec 1 19:43:51 EST 2015


Hi,

I have a excel on US airports, I need to get their zip codes in the
adjacent column. Using Google geocoding, I could read their zip codes
individually. But now I need to run the FOR loop to read all the entries.
My excel file has only 1600 rows with names of Airports in a single column.

This is my code:

data = get_data("/Users/shreyaagarwal/Desktop/Airport and zipcodes.xlsx")
import json print(json.dumps(data))

for element in row:

     g= geocoder.google(element)

     print (g.postal)

This code reads until 5 rows and then stops This is result: None None None
None 54015 None

Which is not correct! Please help. I need to get the zip codes adjacent to
the airports in the excel. Is it possible?



-- 
Regards,
Shreya Agarwal

"A setback is nothing but a setup for a comeback!"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ncr-python.in/attachments/20151201/5e6e6861/attachment.html>


More information about the Ncr-Python.in mailing list