'Add a list of new Column objects ``cols`` to the table.  If a
corresponding list of ``indexes`` is supplied then insert column
before each ``index`` position in the *original* list of columns,
otherwise append columns to the end of the list.
Parameters
cols : list of Columns
Column objects to add.
indexes : list of ints or `None`
Insert column before this position or at end (default).
names : list of str
Column names
copy : bool
Make a copy of the new columns. Default is True.
rename_duplicate : bool
Uniquify new column names if they duplicate the existing ones.
Default is False.
Examples
Create a table with two columns \'a\' and \'b\'::
>>> t = Table([[1, 2, 3], [0.1, 0.2, 0.3]], names=(\'a\', \'b\'))
>>> print(t)
a   b
1 0.1
2 0.2
3 0.3
Create column \'c\' and \'d\' and append them to the end of the table::
>>> col_c = Column(name=\'c\', data=[\'x\', \'y\', \'z\'])
>>> col_d = Column(name=\'d\', data=[\'u\', \'v\', \'w\'])
>>> t.add_columns([col_c, col_d])
>>> print(t)
a   b   c   d
1 0.1   x   u
2 0.2   y   v
3 0.3   z   w
Add column \'c\' at position 0 and column \'d\' at position 1. Note that
the columns are inserted before the given position::
>>> t = Table([[1, 2, 3], [0.1, 0.2, 0.3]], names=(\'a\', \'b\'))
>>> col_c = Column(name=\'c\', data=[\'x\', \'y\', \'z\'])
>>> col_d = Column(name=\'d\', data=[\'u\', \'v\', \'w\'])
>>> t.add_columns([col_c, col_d], [0, 1])
>>> print(t)
c   a   d   b
x   1   u 0.1
y   2   v 0.2
z   3   w 0.3
Add second column \'b\' and column \'c\' with ``rename_duplicate``::
>>> t = Table([[1, 2, 3], [0.1, 0.2, 0.3]], names=(\'a\', \'b\'))
>>> col_b = Column(name=\'b\', data=[1.1, 1.2, 1.3])
>>> col_c = Column(name=\'c\', data=[\'x\', \'y\', \'z\'])
>>> t.add_columns([col_b, col_c], rename_duplicate=True)
>>> print(t)
a   b  b_1  c
1 0.1 1.1  x
2 0.2 1.2  y
3 0.3 1.3  z
Add unnamed columns or mixin objects in the table using default names
or by specifying explicit names with ``names``. Names can also be overridden::
>>> t = Table()
>>> col_a = Column(data=[\'x\', \'y\'])
>>> col_b = Column(name=\'b\', data=[\'u\', \'v\'])
>>> t.add_columns([col_a, col_b])
>>> t.add_columns([col_a, col_b], names=[\'c\', \'d\'])
>>> print(t)
col0  b   c   d
x   u   x   u
y   v   y   v'

def add_columns(self, cols, indexes=None, names=None, copy=True, rename_duplicate=False):

    if (indexes is None):
        indexes = ([len(self.columns)] * len(cols))
    elif (len(indexes) != len(cols)):
        raise ValueError(u'Number    of    indexes    must    match    number    of    cols')
    if copy:
        cols = [col_copy(col) for col in cols]
    if (len(self.columns) == 0):
        newcols = cols
    else:
        newcols = list(self.columns.values())
        new_indexes = list(range((len(newcols) + 1)))
        for (col, index) in zip(cols, indexes):
            i = new_indexes.index(index)
            new_indexes.insert(i, None)
            newcols.insert(i, col)
    if (names is None):
        names = ((None,) * len(cols))
    elif (len(names) != len(cols)):
        raise ValueError(u'Number    of    names    must    match    number    of    cols')
    for (i, (col, name)) in enumerate(zip(cols, names)):
        if (name is None):
            if (col.info.name is not None):
                continue
            name = u'col{}'.format((i + len(self.columns)))
        if (col.info.parent_table is not None):
            col = col_copy(col)
        col.info.name = name
    if rename_duplicate:
        existing_names = set(self.colnames)
        for col in cols:
            i = 1
            orig_name = col.info.name
            while (col.info.name in existing_names):
                if (col.info.parent_table is not None):
                    col = col_copy(col)
                new_name = u'{0}_{1}'.format(orig_name, i)
                col.info.name = new_name
                i += 1
            existing_names.add(new_name)
    self._init_from_cols(newcols)
