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

Function read_prices

Solutions/6_12/report.py:21–26  ·  view source on GitHub ↗

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

(filename)

Source from the content-addressed store, hash-verified

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

Callers 1

portfolio_reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected