LabelizedVariable.changeLabel
- LabelizedVariable.changeLabel(pos, aLabel)
Change the label at the specified index
- Parameters:
pos (
int) – the index of the label to be changedaLabel (
str) – the label to be added to the labelized variable
- Raises:
pyagrum.DuplicateElement – If the variable already contains the new label
pyagrum.OutOfBounds – If the index is greater than the size of the variable
pyagrum.InvalidArgument – if a label has an ASCII control character (a new line, a tabulation…); an empty label is accepted
- Return type:
None
Example
import pyagrum as gum
c = gum.LabelizedVariable("c", "color", ["red", "green", "blue"])
c.changeLabel(1, "yellow")
print(c)
# c:Labelized({red|yellow|blue})
Class