The following code does not give me any errors when executed. However, when I drag/drop the file into url: geojson.io I get the following "invalid Json file:Syntax error unexpected token".
#!/usr/bin/python
import csv
import json
import geojson
csvfile = open('May_6th.csv', 'rU')
jsonfile = open('file.json', 'w')
fieldnames = {'type': 'FeatureCollection',
'features':[("Name","Bearing (True)","Bearing (Mag)",
"Distance","Total Distance","Planned Speed",
"Leg Time", "Total Time", "Turn", "Latitude", "Longitude")]}
reader = csv.DictReader( csvfile, fieldnames)
for row in reader:
json.dump(row, jsonfile)
jsonfile.write('\n')
print 'csv file converted'
jsonfile.write('\n')?