swat.cas.table.CASTable.drop

CASTable.drop(labels, axis=0, level=None, inplace=False, errors='raise')

Return a new CASTable object with the specified columns removed

Parameters:
labels : string or list-of-strings

The items to remove.

axis : int, optional

Only axis=1 is supported.

level : int or string, optional

Not implemented.

inplace : boolean, optional

If True, apply the operation in place and return None.

errors : string, optional

If ‘raise’, then an exception is raised if the requested labels do not exist. If ‘ignore’, any errors are ignored.

Returns:
self

If inplace == True

CASTable

If inplace == False

Examples

>>> tbl = CASTable('my-table')
>>> print(tbl.columns)
Index(['A', 'B', 'C'], dtype='object')
>>> tbl = tbl.drop(['B', 'C'], axis=1)
>>> print(tbl.columns)
Index(['A'], dtype='object')