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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started