DATA M EXAMS Programation 2
DATA M EXAMS Programation 2
Remember that you are encouraged to discuss the problems with your instructors and classmates, but you must write
all code and solutions on your own.
The rules to be followed for the assignment are:
• Do NOT load additional packages beyond what we’ve shared in the cells below.
• Some problems with code may be autograded. If we provide a function or class API do not change it.
• Do not change the location of the data or data directory. Use only relative paths to access the data.
import argparse
import pandas as pd
import numpy as np
import pickle
from pathlib import Path
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]
# YOUR TASK : Write code to assign the values to the respective variables .
1
This cell has hidden test cases that will run after you submit your assignment .
You can troubleshoot using the unit tests we shared below .
Unit Tests:
import unittest
tests = TestKnn ()
tests_to_run = unittest . TestLoader () . loadTestsFromModule ( tests )
unittest . TextTestRunner () . run ( tests_to_run )
• Hidden tests are run against x and y values. These should be array-like objects (list or series).
def func () :
’’’
Output : x , y , title , x - label , y - label
’’’
x = []
y = []
title = ’ ’
2
x_label = ’ ’
y_label = ’ ’
The cell below can be used to test our scatter plot . You don ’ t need to modify this . Simply execute
Once the func () function above has been completed we can test it by running the cell below . Running
deep7.PNG
This cell has hidden test cases that will run after you submit your assignment .
You can troubleshoot by calling the function and checking return types and values .