''' DS2500 Spring 2025 utils.py -- functions that we use over and over again ''' import csv def read_csv(filename, skip = 1): ''' params: filename (req) string, and skip (opt) for # lines to skip returns: 2d list of strings does: reads in the CSV file using the csv library, skips the given number of lines/header, returns a 2d list ''' data = [] with open(filename, "r") as infile: csvfile = csv.reader(infile) for _ in range(skip): next(csvfile) for row in csvfile: data.append(row) return data