I got help from a youtube tutorial linked below
- import csv and import json packages
- Create a file path to your CSV file: csvFilePath = ?csv_file_name.csv?
- Create a file path to your JSON file: jsonFilePath = ?json_file_name.json?
- Create an empty dictionary to store your converted JSON data: data = {}
- Open and read the CSV:
Open and read CSV file
7. Create a JSON file with the file path from step 3 to write converted data on
Create new JSON file and write on it
Final code snippet
Final code example
Note to self:
Dictionaries ? maps a set of objects (keys) to another set of objects (values).
- Use {} to create a dictionary and to index it.
- Separate key and value pairs with : and commas between each key pair
YouTube tutorial ? thank you ProProgramming101