watex.utils.rename_labels_in#

watex.utils.rename_labels_in(arr, new_names, coerce=False)[source]#

Rename label by a new names

Parameters:
  • arr – arr: array-like |pandas.Series array or series containing numerical values. If a non-numerical values is given , an errors will raises.

  • new_names – list of str; list of string or values to replace the label integer identifier.

  • coerce – bool, default =False, force the ‘new_names’ to appear in the target including or not some integer identifier class label. coerce is True, the target array hold the dtype of new_array; coercing the label names will not yield error. Consequently can introduce an unexpected results.

Returns:

array-like, An array-like with full new label names.