Module Expr Str Import alias Import alias FunctionDef arguments args NameParam defaults Str body Expr Str Assign NameStore ListLoad With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore ListLoad For NameStore SubscriptLoad NameLoad Slice Num body Expr Call AttributeLoad NameLoad attr DictComp SubscriptLoad NameLoad Index NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults Str body Expr Str With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return ListComp NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore ListLoad Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Assert CompareEq NameLoad Call NameLoad decorator_list FunctionDef arguments args defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A Create a function that reads a CSV file and return a list of dictionaries
where the keys are the names in the first row and each dict contains the values
in each subsequent row.

A CSV file 'data.csv' is provided.

Issues: What happens if the row is to long or two short?
What happens with duplicate names in the first row.

Stretch: Convert the DoB strings to actual Python datetime.dates.
 
Created on 18 Feb 2016

@author: paulross
 N/A csv N/A pytest read_csv N/A N/A file_name N/A data.csv N/A N/A Returns a list of dicts from a csv file.
    This does it the hard way. N/A raw_result N/A N/A N/A open file_name f N/A N/A reader N/A N/A csv reader f N/A row reader N/A N/A N/A N/A raw_result append row N/A keys N/A raw_result N/A 0 N/A result N/A N/A row N/A raw_result N/A 1 N/A N/A N/A N/A result append N/A N/A keys N/A i val N/A N/A i val N/A enumerate row N/A result N/A read_csv N/A N/A file_name N/A data.csv N/A N/A Returns a list of dicts from a csv file.
    This is somewhat easier. N/A N/A open file_name f N/A N/A reader N/A N/A csv DictReader f N/A N/A row N/A row reader N/A test_read_csv N/A N/A N/A N/A N/A expected N/A N/A DoB Name Ordinal 08/18/2007 Annabel 1 N/A DoB Name Ordinal 08/19/2007 Brian 2 N/A DoB Name Ordinal 08/20/2007 Charlie 3 N/A DoB Name Ordinal 08/21/2007 Derek 4 N/A DoB Name Ordinal 08/22/2007 Emily 5 N/A DoB Name Ordinal 08/23/2007 Fortune 6 N/A DoB Name Ordinal 08/24/2007 Gerald 7 N/A DoB Name Ordinal 08/25/2007 Harriet 8 N/A DoB Name Ordinal 08/26/2007 India 9 N/A N/A expected N/A read_csv N/A main N/A N/A N/A N/A N/A N/A N/A pytest main __file__ N/A N/A N/A __name__ __main__ N/A N/A N/A main