InfluenceDiagram.changeVariableName
- InfluenceDiagram.changeVariableName(*args)
- Parameters:
var (
int | str) – a variable’s id (int) or namenew_name (
str) – the name of the variable
- Raises:
pyagrum.DuplicateLabel – If this name already exists
pyagrum.NotFound – If no nodes matches id.
- Return type:
None
Example
import pyagrum as gum
diag = gum.fastID("C->*D->$U<-C")
diag.changeVariableName("C", "Weather")
sorted(diag.names())
# ['D', 'U', 'Weather']
diag.idFromName("Weather")
# 0
Class