def append_column(self,column,colname=''):
        """Append a column to the table"""
        
        if not self.table: self.rownames=['%d' %i for i in range(len(column))]
        
        if len(self.rownames)!=len(column):
            raise Exception('differing number of rows, %d rows in the table, %d in the new column' %(len(self.rownames),len(column)))
        
        if colname:
            self.table[colname]=column
            self.colnames.append(colname)
        else:
            ncols=len(self.table.keys())
            self.table['C%d' %ncols]=column
            self.colnames.append('C%d' %ncols)
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/DataFrame.append_column/original