# import function to read csv file from FileReader import readCSV # import math library import math # get numbers from dataset dataSet = readCSV('CSV_files/test.csv') ################################################################################# ################################################################################# ######################### LET USER TEST FUNCTIONS ########################## ################################################################################# ################################################################################# choice = '' print('Select operation!') print('1.Median') print('2.Standard Deviation') print('3.Calculate Z-Score for each Number') print('4.Calculate Population Variance') choice = input('Enter choice:') if choice == "1": from Median import median print('median: ', str(median(dataSet))) elif choice == "2": from StandardDeviation import standardDeviation print('standard deviation: ', str(standardDeviation(dataSet))) elif choice == "3":
# coding: utf-8 # import function to read csv file from FileReader import readCSV # import math library import math # get numbers from dataset dataSet = readCSV('csv/test.csv') ################################################################################# choice = '' print('Select operation!') print('1.Population Standard Deviation') print('2.Variance of Population Proportion') print('3.Calculate Z-Score for each Number') print('4.Sample Standard Deviation') print('5.Variance of Sample Proportion') choice = input('Enter choice:') if choice == "1": from StatisticsModule import populationStandardDeviation print('Standard Deviation - Population: ', str(populationStandardDeviation(dataSet))) elif choice == "2": from StatisticsModule import variancePopulationProportion print('variance- Population: ', str(variancePopulationProportion(dataSet))) elif choice == "3": from StatisticsModule import zScore
def test_csv_reader(): dataSet = readCSV('CSV_files/test.csv') assert len(dataSet) == 19 * 2
def test_csv_reader_fail(): dataSet = readCSV('CSV_files/test.csv') assert len(dataSet) != 19
def test_csv_reader(): dataSet = readCSV('../../MiniProject2/CSV_files/test.csv') assert len(dataSet) == 19 * 2
import math from FileReader import readCSV import scipy from scipy.stats import t import numpy dataSet = readCSV('../../MiniProject2/CSV_files/test.csv') testData = [1, 2, 3] def test_csv_reader(): dataSet = readCSV('../../MiniProject2/CSV_files/test.csv') assert len(dataSet) == 19 * 2 def test_csv_reader_fail(): dataSet = readCSV('CSV_files/test.csv') assert len(dataSet) != 19 #1 - Population Mean Tests def test_calc_populationMean(): from StatisticsModule import populationMean assert populationMean(testData) == 2 def test_calc_populationMean_fail(): from StatisticsModule import populationMean assert populationMean(testData) != 1