def testCSVIntegrity(self): print("** Test CSV Integrity **") the_normalizer = Normalizer("datasets/test_normalization.csv") data = the_normalizer.get_csv() origin_data = [['0', '3', '0'], ['1', '33', '100'], ['0.5', '6', '90']] length = 3 self.assertTrue(data == origin_data, "Data and CSV file doesn't match") self.assertTrue(length == the_normalizer.getRowLength(), "Line length doesn't match")
def __init__(self, k, n, columns, datafile): """Constructeur pour la classe KMeanClusterer""" super(KMeanClusterer, self).__init__() # Number of clusters wanted self.k = k self.n = n self.is_over = False # columns to work with self.columns = sorted(columns) # Get CSV data norm = Normalizer(datafile) self.data = norm.normalize() self.row_length = norm.getRowLength() self.clusters = []