LabelizedVariable.addLabel
- LabelizedVariable.addLabel(*args)
Add a label with a new index (we assume that we will NEVER remove a label).
- Parameters:
aLabel (
str) – the label to be added to the labelized variable- Returns:
the labelized variable
- Return type:
- Raises:
pyagrum.DuplicateElement – If the variable already contains the label
pyagrum.InvalidArgument – If the label has an ASCII control character (a new line, a tabulation…); an empty label is accepted
Example
import pyagrum as gum
c = gum.LabelizedVariable("c", "color", 0)
c.addLabel("red").addLabel("green")
print(c)
# c:Labelized({red|green})
Class