datascience.tables.Table.relabeled¶
-
Table.relabeled(label, new_label)[source]¶ Returns a table with label changed to new_label.
labelandnew_labelmay be single values or lists specifying column labels to be changed and their new corresponding labels.- Args:
label(str or sequence of str): The label(s) of- columns to be changed.
new_label(str or sequence of str): The new label(s) of- columns to be changed. Same number of elements as label.
>>> tiles = Table(['letter', 'count']) >>> tiles = tiles.with_rows([['c', 2], ['d', 4]]) >>> tiles.relabeled('count', 'number') letter | number c | 2 d | 4