MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / parse_stock_data

Function parse_stock_data

Solutions/7_9/ticker.py:20–25  ·  view source on GitHub ↗
(lines)

Source from the content-addressed store, hash-verified

18 return (dict(zip(headers,row)) for row in rows)
19
20def parse_stock_data(lines):
21 rows = csv.reader(lines)
22 rows = select_columns(rows, [0, 1, 4])
23 rows = convert_types(rows, [str,float,float])
24 rows = make_dicts(rows, ['name','price','change'])
25 return rows
26
27def ticker(portfile, logfile, fmt):
28 portfolio = report.read_portfolio(portfile)

Callers 1

tickerFunction · 0.70

Calls 3

select_columnsFunction · 0.70
convert_typesFunction · 0.70
make_dictsFunction · 0.70

Tested by

no test coverage detected