Python Forum

Full Version: Python - List from csv files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a csv file that contains a set of records which represent a list of x,y coordinates.

I want to know how to get them from the file and into a list as shown below. (I made it manually)

#Create list of city coordinates
coords_list = [(38.24, 20.42), (39.57, 26.15), (40.56, 25.32), (36.26, 23.12), (33.48, 10.54), (37.56, 12.19), (38.42, 13.11), (37.52, 20.44), (41.23, 9.10),(41.17, 13.05),(36.08, -5.21),(38.47, 15.13), (38.15, 15.35),(37.51, 15.17),(35.49, 14.32),(39.36, 19.56)]

Many thanks in advance for looking at this.