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

Function read_prices

Solutions/3_14/report.py:12–16  ·  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

10 return fileparse.parse_csv(filename, select=['name','shares','price'], types=[str,int,float])
11
12def read_prices(filename):
13 '''
14 Read a CSV file of price data into a dict mapping names to prices.
15 '''
16 return dict(fileparse.parse_csv(filename,types=[str,float], has_headers=False))
17
18def make_report_data(portfolio,prices):
19 '''

Callers 1

portfolio_reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected