I got help from a youtube tutorial linked below
import csv
andimport 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:
7. Create a JSON file with the file path from step 3 to write converted data on
Final code snippet
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