'Keep only the columns specified (remove the others).
Parameters
names : list
A list containing the names of the columns to keep. All other
columns will be removed.
Examples
Create a table with three columns \'a\', \'b\' and \'c\'::
>>> t = Table([[1, 2, 3],[0.1, 0.2, 0.3],[\'x\', \'y\', \'z\']],
...           names=(\'a\', \'b\', \'c\'))
>>> print(t)
a   b   c
1 0.1   x
2 0.2   y
3 0.3   z
Specifying only a single column name keeps only this column.
Keep only column \'a\' of the table::
>>> t.keep_columns(\'a\')
>>> print(t)
a
1
2
3
Specifying a list of column names is keeps is also possible.
Keep columns \'a\' and \'c\' of the table::
>>> t = Table([[1, 2, 3],[0.1, 0.2, 0.3],[\'x\', \'y\', \'z\']],
...           names=(\'a\', \'b\', \'c\'))
>>> t.keep_columns([\'a\', \'c\'])
>>> print(t)
a   c
1   x
2   y
3   z'

def keep_columns(self, names):

    if isinstance(names, six.string_types):
        names = [names]
    for name in names:
        if (name not in self.columns):
            raise KeyError(u'Column    {0}    does    not    exist'.format(name))
    remove = list((set(self.keys()) - set(names)))
    self.remove_columns(remove)
