astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- Data Tables (`astropy.table`) »
- ColumnGroups

# ColumnGroups

class `astropy.table.``ColumnGroups`(parent_column, indices=None, keys=None)

  Bases: `astropy.table.groups.BaseGroups`

  Attributes Summary

  `indices` |
  `keys` |

  Methods Summary

  `aggregate`(func) |
  `filter`(func) | Filter groups in the Column based on evaluating function `func` on each group sub-table.

  Attributes Documentation

  `indices`
  `keys`

  Methods Documentation

  `aggregate`(func)
  `filter`(func)

    Filter groups in the Column based on evaluating function `func` on each group sub-table.

    The function which is passed to this method must accept one argument:

    - `column` : `Column` object

    It must then return either `True` or `False`. As an example, the following will select all column groups with only positive values:

        def all_positive(column):
            if np.any(column < 0):
                return False
            return True

    Parameters:

    func : function

    > Filter function

    Returns:

    out : Column

    > New column with the aggregated rows.