Last active
February 4, 2020 02:59
-
-
Save guerbai/8adfbf918df0d03608e72c1df76bc340 to your computer and use it in GitHub Desktop.
csv
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 | |
filename = './test.csv' | |
with open(filename, 'r') as f: | |
data_csv = csv.DictReader(f, delimiter=',') | |
for data in data_csv: | |
print (data['clip_id']) |
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 | |
ids_map_csv = './test.csv' | |
with open(ids_map_csv, 'w') as f: | |
writer = csv.writer(f) | |
writer.writerow(['old_id', 'new_id']) | |
with open(filename, 'r') as f: | |
data_csv = csv.DictReader(f, delimiter=',') | |
for data in data_csv: | |
writer.writerow([1, 2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment