You've split a CSV file into a header and some rows. Every row is a list of text values in the same order as the header.
Write to_records(header, rows). It returns a list of dictionaries, one per row, where each key comes from the header and each value from that row.
Keep the rows in order. No rows gives back an empty list.