Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import radians, cos, sin, asin, sqrt
- import csv
- # def haversine(lon1, lat1, lon2, lat2):
- # """
- # Calculate the great circle distance between two points
- # on the earth (specified in decimal degrees)
- # """
- # # convert decimal degrees to radians
- # lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
- #
- # # haversine formula
- # dlon = lon2 - lon1
- # dlat = lat2 - lat1
- # a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
- # c = 2 * asin(sqrt(a))
- # r = 6371 # Radius of earth in kilometers. Use 3956 for miles
- # return c * r
- # print (haversine(-122.296021, 37.887058, -119.68233, -122.296021))
- import csv
- data= []
- with open('C:/Users/thomascl20/Desktop/CA.csv', newline='') as csvfile:
- spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
- for row in spamreader:
- data.append(row.split("'"))
- print(data[1][1])
- print(data[1][0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement