Question

In: Computer Science

Implement a generic utility to summarize a table of data. In particular, for specified columns, find...

Implement a generic utility to summarize a table of data. In particular, for specified columns, find the minimum, average, and maximum value for each of those columns and print out a nicely-formatted report. Hint: You might want to process one line at a time maintaining, in a dictionary, the running stats for each column.

For example: stats = '{'test1': {'min': 80.5, 'sum':845.0, 'max':100.0}, 'test2': {...}, ...etc.' If you also maintain a row counter, you’ll be able to calculate the averages after you have accumulated statistics on each column.

Post answer in PYTHON script using ATOM or REPL

DO NOT IMPORT PANDAS or DATA FRAMES to solve

Solutions

Expert Solution

Python code for the above:
I've used Jupyter notebook to show you how the above can be obtained on sample data, however, the steps remain the same for any other data.


Related Solutions

You'll implement a completely generic version of an algorithm to find the maximum of an array....
You'll implement a completely generic version of an algorithm to find the maximum of an array. Unlike in the past, when our algorithm only worked for int[] or double[], this version will work on any Java objects that are comparable, specifically any Java object that implements the Comparable interface. Create a public class named Max with a single class method named max. max should accept an array of Objects that implement Comparable and return the maximum. If the array is...
The data in columns 1 and 2 in the table below are for a private closed...
The data in columns 1 and 2 in the table below are for a private closed economy. GDP A.E. Private Closed Economy Exports Imports Net Exports A.E. Private Open Economy 200 240 20 30 250 280 20 30 300 320 20 30 350 360 20 30 400 400 20 30 450 440 20 30 500 480 20 30 550 520 20 30 a. Use columns 1 and 2 to determine the equilibrium GDP for this hypothetical economy. b. Now open...
Modify the HighArray class to implement the method specified below, which reads integer data from a...
Modify the HighArray class to implement the method specified below, which reads integer data from a file to fill the array. The first integer read from the file should indicate the number of integers contained in the file which can be read into the array. /** * Read integers into array from named file. First element in * file is a count of number of integers contained in the file. * * @param fileName   name of file containing integer data...
#data structure 1.Implement the generic PriorityQueueInterface in a class named PriorityQueue. Note: it must be named...
#data structure 1.Implement the generic PriorityQueueInterface in a class named PriorityQueue. Note: it must be named PriorityQueue The priority queue MUST be implemented using a linked list. 2 test program checks that a newly constructed priority queue is empty o checks that a queue with one item in it is not empty o checks that items are correctly entered that would go at the front of the queue o checks that items are correctly entered that would go at the...
Suppose a firm has the following production possibilities data (left columns in the table below), please...
Suppose a firm has the following production possibilities data (left columns in the table below), please determine its Marginal Cost (MC) data and write them in the right columns. PPF MC Pizza (per hour) Bagel (per hour) Pizza (per hour) Bagel (per hour) 0 30 - - 2 28 4 24 6 18 8 10 10 0
For the data in the​ table, find the mean and the median of the monthly high...
For the data in the​ table, find the mean and the median of the monthly high temperatures. Then do the same for the monthly low temperatures.What is the mean of the monthly high​ temperatures? month high low Jan 16 7 Feb 23 13 Mar 29 18 April 43 30 May 56 45 The mean of the high temperatures °F. ​(Type an integer or a​ decimal.) What is the median of the monthly high​ temperatures? The median of the high temperatures...
I have extra columns with data showing up in my pivot table. How can I get...
I have extra columns with data showing up in my pivot table. How can I get rid of the extra columns?
The following table shows income distribution data for an economy in a particular year. Household Group...
The following table shows income distribution data for an economy in a particular year. Household Group Share of Aggregate Income One-fifth with lowest income 4.7% Next lowest one-fifth 8.5% Middle one-fifth 19.4% Next highest one-fifth 27.6% One-fifth with highest income 39.8% What is the Gini coefficient?
Consider the data in table below which shows the time required to produce a particular item....
Consider the data in table below which shows the time required to produce a particular item. Using that data, calculate the learning rate associated with this product. Units Labor Hrs 5 155 9 147 13 137 17 97 25 72
The following table shows income distribution data for an economy in a particular year. Household Group                         &n
The following table shows income distribution data for an economy in a particular year. Household Group                                      Share of Aggregate Income    One-fifth with lowest income                                   8.1%                      Next lowest one-fifth 11.5%                    Middle one-fifth                                                20.0%                           Next highest one-fifth                                    22.8%                           One-fifth with highest income                               37.6%                          What is the Gini coefficient for this economy? .440 .328 .281 1.453 .459
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT