Skip to main content
`Ctrl`+`K`

# TableColumns

class astropy.table.TableColumns(cols={})

  Bases: `OrderedDict`

  OrderedDict subclass for a set of columns.

  This class enhances item access to provide convenient access to columns by name or index, including slice access. It also handles renaming of columns.

  The initialization argument `cols` can be a list of `Column` objects or any structure that is valid for initializing a Python dict. This includes a dict, list of (key, val) tuples or [key, val] lists, etc.

  Parameters:
    cols `python:dict`, `python:list`, tuple; optional

      Column objects as data structure that can init dict (see above)

  Methods Summary

  `isinstance`(cls) | Return a list of columns which are instances of the specified classes.
  `not_isinstance`(cls) | Return a list of columns which are not instances of the specified classes.
  `setdefault`(key, default) |
  `update`(*args, **kwargs) |

  Methods Documentation

  isinstance(cls)

    Return a list of columns which are instances of the specified classes.

    Parameters:
      cls class or `python:tuple` thereof

        Column class (including mixin) or tuple of Column classes.

    Returns:
      col_list `python:list` of `Column`

        List of Column objects which are instances of given classes.

  not_isinstance(cls)

    Return a list of columns which are not instances of the specified classes.

    Parameters:
      cls class or `python:tuple` thereof

        Column class (including mixin) or tuple of Column classes.

    Returns:
      col_list `python:list` of `Column`

        List of Column objects which are not instances of given classes.

  setdefault(key, default)

    Deprecated since version 6.1: The t.columns.setdefault() function is deprecated and may be removed in a future version. Use t.setdefault() instead.

  update(*args, **kwargs)

    Deprecated since version 6.1: The t.columns.update() function is deprecated and may be removed in a future version. Use t.update() instead.