A data cube is a list of one or more dimensions with data of

A data cube is a list of one or more dimensions with data of interest to an organization. For example, you might have a data cube of 2 dimensions where one dimension is the state and another is the year. Accessing datacube[state][year]gives the population of the state for that year. Different kinds of analyses can be performed on the cube as given below.

• Aggregation or roll-up: an example is average population by state

• Selection or slice: an example is populations of one state over a particular time period

• Detailed data or drill-down: which cities grew by 10% over a particular time period

Aggregation

Slice

Drill-Down

Which states grew in population at least 10% from 1950 to 1970?

New Hampshire 38%, Texas 45%, Colorado 67%

Create a Python program to allow a user to use the table above, perform the aggregation, slicing, and drilling-down examples given. On aggregation, allow the user to choose average, max, and min. On slicing, allow the user to choose the state and the year ranges. On drilling-down, allow the user to choose the percent and the year ranges.

Download the 2015 fuel economy datafile from http://www.fueleconomy.gov/feg/download.shtml. Open it and save the file as a .csv file so that you can use it with a Python program.

Write a Python program to allow a user to perform the following aggregation, slice, and drill-down operations on the file. Allow the user to input requested data and which question to ask. Allow the user to ask as many questions as desired before terminating the program. Read the data needed to answer each question into a two-dimensional array so that you only have to read the file in once. Results should be aligned in columns and neatly printed with up to 2 decimal places for floating point numbers. Perform input validation and utilize two or more functions in the program.

• Aggregation

o What is the average highway mileage (guide) for n cylinder vehicles? User chooses n.

o What is the maximum highway mileage (guide) for n cylinder vehicles? User chooses n.

o What is the minimum highway mileage (guide) for n cylinder vehicles? User chooses n.

• Slice

o List all of the “carline class desc” (column br) along with their data entries of city mileage (guide) and

highway mileage (guide), make, and model with highway mileage greater than n. User chooses the

carline class desc and n.

• Drill-Down

o Give the percentage of vehicles in the “carline class desc” which have a highway mileage (guide) of n.

User chooses carline class desc and n.

Then code your algorithm in Python and include proper comments along with the code to explain it. You can copy your algorithm into the Python code and add further comments.

Solution

In modular arithmetic the set of congruence classes relatively prime to the modulus number, say n, form a group under multiplication called the multiplicative group of integers modulo n. It is also called the group of primitive residue classes modulo n. In the theory of rings, a branch of abstract algebra, it is described as the group of units of the ring of integers modulo n. (Units refers to elements with a multiplicative inverse.)

A data cube is a list of one or more dimensions with data of interest to an organization. For example, you might have a data cube of 2 dimensions where one dime
A data cube is a list of one or more dimensions with data of interest to an organization. For example, you might have a data cube of 2 dimensions where one dime

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site