Download pool/shard006/Python/0053768_clean_csv.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/Python/0053768_clean_csv.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard006/Python/0053768_clean_csv.py
-
curl -L -o 0053768_clean_csv.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/Python/0053768_clean_csv.py
559 Bytes
| import csv | |
| from os import listdir | |
| from os.path import join | |
| base_dir = '/home/mjc/sdc/CarND-Behavioral-Cloning/data/mrg/IMG' | |
| img_files = listdir('data/mrg/IMG/') | |
| with open('data/mrg/driving_log_clean_hal.csv', 'w') as wf: | |
| with open('data/mrg/driving_log.csv', 'r') as rf: | |
| reader = csv.reader(rf) | |
| writer = csv.writer(wf) | |
| for row in reader: | |
| rel_path = row[0].split('\\')[-1] | |
| if rel_path in img_files: | |
| real_path = join(base_dir, rel_path) | |
| writer.writerow([real_path, row[3]]) | |