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

Function read_prices

Solutions/7_4/report.py:22–27  ·  view source on GitHub ↗

Read a CSV file of price data into a dict mapping names to prices.

(filename, **opts)

Source from the content-addressed store, hash-verified

20 return Portfolio(portfolio)
21
22def read_prices(filename, **opts):
23 '''
24 Read a CSV file of price data into a dict mapping names to prices.
25 '''
26 with open(filename) as lines:
27 return dict(fileparse.parse_csv(lines,types=[str,float], has_headers=False, **opts))
28
29def make_report_data(portfolio, prices):
30 '''

Callers 1

portfolio_reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected