def append_row(self,row,rowname=''):
        """Append a row to the end of the table"""
        
        ncols=len(self.colnames)
        lasti=0
        for i in range(min(ncols,len(row))):
            try:
                self.table[self.colnames[i]].append(row[i])
            except KeyError: # when the table is empty
                for colname in self.colnames:
                    self.table[colname]=[]
                self.table[self.colnames[i]].append(row[i])
            
            lasti=i
        
        if ncols-1 < lasti:    # when the given row is shorter than the row length of the table, add 0s
            for j in range(i,ncols):
                self.table[self.colnames[j]].append(0)
        
        if rowname:
            self.rownames.append(rowname)
        else:
            self.rownames.append('%d' %len(self.rownames))
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/DataFrame.append_row/swapped operands of `<`