Python - List from csv files - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Python - List from csv files (/thread-25082.html) |
Python - List from csv files - Wscwt011 - Mar-18-2020 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. RE: Python - List from csv files - alpho - Mar-18-2020 This might help. https://www.geeksforgeeks.org/reading-excel-file-using-python/ |