Last active
March 27, 2019 03:37
-
-
Save toshihiroryuu/e41b42173589019f1a45db7cb7bbb058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
PATH='/home/udacity_driving_datasets' | |
f1 = open('/home/quest/train.csv') | |
csv_f = csv.reader(f1) | |
for row in csv_f: | |
name=row[0] | |
listt='' | |
listt='/home/udacity_driving_datasets/'+name | |
with open('/home/trainsample.csv', mode='a') as csv_file: | |
fieldnames = ['frame', 'xmin', 'xmax','ymin', 'ymax', 'class_id'] | |
writer = csv.DictWriter(csv_file, fieldnames=fieldnames) | |
# writer.writeheader() | |
writer.writerow({'frame': listt, 'xmin': row[1], 'xmax': row[2], 'ymin': row[3], 'ymax': row[4], 'class_id':row[5]}) | |
print("copies row") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment