Question: Python fh = open('BreadBasket_DMS.csv','r') def getItems (aDictionary,ToporBottom,N): if ToporBottom>0: Npairs = {k: aDictionary[k] for k in aDictionary.keys()[:N]} return Npairs elif ToporBottom Read the provided file
![{k: aDictionary[k] for k in aDictionary.keys()[:N]} return Npairs elif ToporBottom Read the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4fe68841ce_94366f4fe67c0d87.jpg)
Python
fh = open('BreadBasket_DMS.csv','r')
def getItems (aDictionary,ToporBottom,N): if ToporBottom>0: Npairs = {k: aDictionary[k] for k in aDictionary.keys()[:N]} return Npairs elif ToporBottom Read the provided file and construct a dictionary where keys are the transaction numbers and values are collections (e.g,, lists, tuples or dictionaries) that store the date, time and items 1. associated with the transactions. 2. Write a function getHourlyTraffic(dateInfo) that gives in percentage the (average) hourly traffic for the provided date Info parameter. The valid dateInfo parameters are months (e.g., January, February, etc), days of the week (Monday, Tuesdays, etc) or dates in the correct format (e.g., 2018-11-09) . .The function should return a dictionary where the keys are hours of the day (e.g., 00,01",... 23) and values are, in percentage, the (average) hourly traffic for the provided date Info parameter The function must return None if any of the input parameters are invalid 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
