Python Forum
Python - List from csv files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python - List from csv files
#1
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.
Reply
#2
This might help.
https://www.geeksforgeeks.org/reading-ex...ng-python/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Need help for a python script to extract information from a list of files lephunghien 6 1,033 Jun-12-2023, 05:40 PM
Last Post: snippsat
  list the files using query in python arjunaram 0 649 Mar-28-2023, 02:39 PM
Last Post: arjunaram
  How to download a list of files from FTP? schnarkle 0 974 Jun-21-2022, 10:35 PM
Last Post: schnarkle
  get all the files in the path in a list? korenron 23 6,855 Jul-19-2021, 07:44 AM
Last Post: korenron
  Put all files in a directory into list. How? Denial 2 2,079 Sep-18-2020, 10:05 PM
Last Post: Larz60+
  How to list out specific excel files ajay_pal7 2 2,759 Mar-10-2020, 05:43 AM
Last Post: Larz60+
  Details of attachment files in a msg file such as file names save into a python list klllmmm 2 5,625 Nov-12-2019, 05:59 AM
Last Post: klllmmm
  unable to list files in a directory christober 2 2,004 Sep-18-2019, 11:45 PM
Last Post: wavic
  Running a python tool transforming xml files into epub files silfer 7 5,313 May-10-2018, 03:49 PM
Last Post: snippsat
  List files with a specific extension pyth0nus3r 8 15,383 Jan-12-2017, 10:23 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020