<commit_before>import csv

with open('json/2016_playerpicks.csv', 'r') as playerpicks:
    # fieldnames = [timestamp,firstname,lastname,email,afc_east_first,afc_east_second,afc_east_last,
#                  afc_north_first,afc_north_second,afc_north_last,afc_south_first,afc_south_second,
#                  afc_south_last,afc_west_first,afc_west_second,afc_west_last,nfc_east_first,
#                  nfc_east_second,nfc_east_last,nfc_north_first,nfc_north_second,nfc_north_last,
#                  nfc_south_first,nfc_south_second,nfc_south_last,nfc_west_first,nfc_west_second,
#                  nfc_west_last,afc_wildcard1,afc_wildcard2,nfc_wildcard1,nfc_wildcard2,afc_rushing_leader,
#                  afc_passing_leader,afc_receiving_leader,afc_sacks_leader,afc_int_leader,afc_pf,
#                  nfc_rushing_leader,nfc_passing_leader,nfc_receiving_leader,nfc_sacks_leader,
#                  nfc_int_leader,nfc_pf,tiebreaker]
    reader = csv.DictReader(playerpicks)
    for row in playerpicks:
        print(row)

<commit_msg>Import player picks from CSV and make into a named tuple (instead of a dictionary)<commit_after>import csv
import collections
from collections import namedtuple

nfl_pool_players = []
player_picks = ()

with open('json/2016_playerpicks.csv') as infile:
    reader = csv.DictReader(infile)
    picks = collections.namedtuple('picks', reader.fieldnames)
    player_picks = [picks(**row) for row in reader]

print(player_picks[0])

{'fraction_non_alphanumeric': 0.07975460122699386, 'fraction_numerical': 0.008861622358554875, 'mean_word_length': 4.5606060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7454595', 'n_tokens_mistral': 574, 'n_tokens_neox': 522, 'n_words': 64}