File: exclude.py

package info (click to toggle)
python-agate 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,996 kB
  • sloc: python: 8,512; makefile: 126
file content (19 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from agate import utils


def exclude(self, key):
    """
    Create a new table without the specified columns.

    :param key:
        Either the name of a single column to exclude or a sequence of such
        names.
    :returns:
        A new :class:`.Table`.
    """
    if not utils.issequence(key):
        key = [key]

    selected_column_names = tuple(n for n in self._column_names if n not in key)

    return self.select(selected_column_names)