Question
Write a function convertDoL(D) that converts from a Dictionary of Lists representation in D to the equivalent List of Lists representation, returning both the list
Write a function
convertDoL(D)
that converts from a Dictionary of Lists representation in D to the equivalent List of Lists representation, returning both the list of column names, as given by the keys of D, as well as a list of lists storing the data in the values of D. Note that, because we do not know the order of mappings in a dictionary, the order of fields in the column names, and the order of fields in the rows of the data set may not be apparent. But as long as all rows as well as the list of column names is consistent, the conversion is valid. Hint: a list comprehension might come in handy.
Assume we will use the function on the files topfemale.csv and topmale.csv
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