datascience.tables.Table.drop

Table.drop(*column_label_or_labels)[source]

Return a Table with only columns other than selected label or labels.

Args:
column_label_or_labels (string or list of strings): The header names or indices of the columns to be dropped. column_label_or_labels must be an existing header name, or a valid column index.
Returns:
An instance of Table with given columns removed.
>>> t = Table().with_columns([
...     'burgers',  ['cheeseburger', 'hamburger', 'veggie burger'],
...     'prices',   [6, 5, 5],
...     'calories', [743, 651, 582]])
>>> t
burgers       | prices | calories
cheeseburger  | 6      | 743
hamburger     | 5      | 651
veggie burger | 5      | 582
>>> t.drop('prices')
burgers       | calories
cheeseburger  | 743
hamburger     | 651
veggie burger | 582
>>> t.drop(['burgers', 'calories'])
prices
6
5
5
>>> t.drop('burgers', 'calories')
prices
6
5
5
>>> t.drop([0, 2])
prices
6
5
5
>>> t.drop(0, 2)
prices
6
5
5
>>> t.drop(1)
burgers       | calories
cheeseburger  | 743
hamburger     | 651
veggie burger | 582