Question: Hello! I am trying to write a python program which takes one command line argument i (i [2, 29]) (and the data file) and computes

Hello! I am trying to write a python program which takes one command line argument i (i [2, 29]) (and the data file) and computes the following values for the i-th attribute of the dataset: N (number of objects), min, max, mean, standard deviation, Q1, median, Q3, and IQR.

I have a .csv file which contains energy data from: http://archive.ics.uci.edu/ml/machine-learning-databases/00374/

I have a template formatted so that:

def calcAttributes( file, ithAttr): # Default value of 0,infinity,-infinity are assigned to all the variables as required.

numObj, minValue, maxValue, mean, stdev, Q1, median, Q3, IQR = [0,"inf","-inf",0,0,0,0,0,0]

return numObj, minValue, maxValue, mean, stdev, Q1, median, Q3, IQR

In this function, I am trying to assign the values to the respective variables, utilizing the data set. However, I have no idea how to begin going about it. Any help would be greatly appreciated.

I do not just want the solution to this issue, a description of what each line does/ why it is important would really help me to understand what is going on in this code. (could just be commented into the code or whatever works best)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!