# create.py

class Table(object):
    pass
    
@@ -6,16 +6,31 @@
 ate.py%0A%0A
+import random%0A%0A
 class Ta
@@ -50,13 +50,1529 @@
     
-pass%0A
+%22%22%22%0A    holds a table and manages the cleaning and %0A    creation of DQ issues%0A    %22%22%22%0A    def __init__(self, tbl, fudge_str):%0A        self.tbl = tbl%0A        self.glitch = DataError(fudge_str)%0A        %0A    def add_errors(self, num=3):%0A        %22%22%22%0A        Adds 'num' errors to the table%0A        %22%22%22%0A        for i in range(1, num+1):%0A            col = random.randint(0,len(self.tbl))%0A            print('col = ', col)%0A            self.tbl%5Bi%5D%5Bcol%5D = self.glitch.random_error(self.tbl%5Bi%5D%5Bcol%5D)%0A            %0A    def swap_columns(self, c1, c2):  %0A        #self.tbl%5Bc1%5D%5B:%5D, self.tbl%5Bc2%5D%5B:%5D = self.tbl%5Bc2%5D%5B:%5D, self.tbl%5Bc1%5D%5B:%5D %0A        for rownum, r in enumerate(self.tbl):%0A            #print('rownum = ', rownum, 'c2 = ', c2, 'c1 = ', c1)%0A            #print('self.tbl%5Brownum%5D%5Bc1%5D = ', self.tbl%5Brownum%5D%5Bc1%5D)%0A            #print('self.tbl%5Brownum%5D%5Bc2%5D = ', self.tbl%5Brownum%5D%5Bc2%5D)%0A            self.tbl%5Brownum%5D%5Bc1%5D, self.tbl%5Brownum%5D%5Bc2%5D = self.tbl%5Brownum%5D%5Bc2%5D, self.tbl%5Brownum%5D%5Bc1%5D%0A%0Aclass DataError(object):%0A    def __init__(self, fudge_string):%0A        self.fudge_string = fudge_string%0A    %0A    def random_error(self, orig):%0A        i = random.randint(1,3)%0A        if i == 1:%0A            return self._fixed_val()%0A        elif i == 2:%0A            return self._blank_out()%0A        elif i == 3:%0A            return self._add_spaces(orig)%0A    %0A    def _fixed_val(self):%0A        return self.fudge_string%0A        %0A    def _blank_out(self):%0A        return ''%0A        %0A    def _add_spaces(self, orig):%0A        return ' ' + orig + '     '%0A        
     

create module to add DQ issues