datascience.tables.Table.move_to_end

Table.move_to_end(column_label)[source]

Move a column to be the last column.

The following example moves column A to be the last column. Note, move_to_end not only returns the original table with the column moved but, it also moves the column in the original. This is what’s known as an inplace operation.

>>> 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.move_to_end("A")
B    | C    | A
foo  | a    | 1
bar  | b    | 2
baz  | c    | 3
bat  | d    | 4
>>> table
B    | C    | A
foo  | a    | 1
bar  | b    | 2
baz  | c    | 3
bat  | d    | 4