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

Function parse_stock_data

Solutions/8_1/ticker.py:19–24  ·  view source on GitHub ↗
(lines)

Source from the content-addressed store, hash-verified

17 return (dict(zip(headers,row)) for row in rows)
18
19def parse_stock_data(lines):
20 rows = csv.reader(lines)
21 rows = select_columns(rows, [0, 1, 4])
22 rows = convert_types(rows, [str,float,float])
23 rows = make_dicts(rows, ['name','price','change'])
24 return rows
25
26def ticker(portfile, logfile, fmt):
27 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