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

Function read_prices

Solutions/8_1/report.py:16–21  ·  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

14 return Portfolio.from_csv(lines, **opts)
15
16def read_prices(filename, **opts):
17 '''
18 Read a CSV file of price data into a dict mapping names to prices.
19 '''
20 with open(filename) as lines:
21 return dict(fileparse.parse_csv(lines, types=[str,float], has_headers=False, **opts))
22
23def make_report(portfolio, prices):
24 '''

Callers 1

portfolio_reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected