Skip to content

NotSingleValueError(value_count) Source

Bases: NumdaplotError

Raised when to_value is called on an Array that does not hold exactly one value.

Added in version 0.1.0

Parameters:

  • value_count (int)

    Number of values held by the Array.

Attributes:

  • value_count

    Number of values held by the Array.

Examples:

import numdaplot as ndp

array = ndp.Array.from_list([1, 2])
try:
    array.to_value()
except ndp.NotSingleValueError as error:
    print(error)
# Expected exactly one value, got 2.