min#
- ParamDictND.min(*pattern)[source]#
Calculate the minimum of all parameter values or a subset based on wildcard pattern.
- Parameters:
- *patternAny, optional
For subsets, the pattern requires one value for each dimension of the N-dim tuple key. The single-character string
'*'(asterisk) can be used as a wildcard to represent all possible values for a dimension.
- Returns:
- int or float
- Raises:
- StatisticsError
If the ParamDict is empty.
- TypeError
If the pattern includes non-scalar(s).
- ValueError
If the pattern is not the same as the length of N-dim tuple keys.
- ValueError
If the pattern has no wildcard or all wildcards.
Examples
>>> demand = ParamDictND({('A', 'B'): 10, ('B', 'C'): 20, ('A', 'C'): 15, ('C', 'A'): 16})
Minimum of all parameter values:
>>> demand.min() 10
Minimum of a subset based on wildcard pattern:
>>> demand.min('A', '*') 10 >>> demand.min('*', 'A') 16