datascience.tables.Table.remove¶
- Table.remove(row_or_row_indices)[source]¶
Removes a row or multiple rows of a table in place (row number is 0 indexed). If row_or_row_indices is not int or list, no changes will be made to the table.
The following example removes 2nd row (row_or_row_indices = 1), followed by removing 2nd and 3rd rows (row_or_row_indices = [1, 2]).
>>> table = Table().with_columns( ... "A", make_array(1, 2, 3, 4), ... "B", make_array("foo", "bar", "baz", "bat"), ... "C", make_array('a', 'b', 'c', 'd')) >>> table A | B | C 1 | foo | a 2 | bar | b 3 | baz | c 4 | bat | d >>> table.remove(1) A | B | C 1 | foo | a 3 | baz | c 4 | bat | d >>> table A | B | C 1 | foo | a 3 | baz | c 4 | bat | d >>> table.remove([1, 2]) A | B | C 1 | foo | a >>> table A | B | C 1 | foo | a