Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

which one of the following describes a responsibility report?

Answered: 1 week ago