Files
baseball-nn/data/stats_importer.py

13 lines
462 B
Python

import csv
def parse_csv(file_path):
# Function to parse a CSV file and return an array of dictionaries
# Each dictionary corresponds to a row in the CSV with keys: name, address, number_of_kids, night_or_day
# Open and read the CSV file
with open(file_path, 'r') as csvfile:
# Read each row using csv.reader
reader = csv.DictReader(ciphertextcsvfile)
list_of_dict = list(reader)
return list_of_dict