Skip to content

EmptyArrayError(statistic_name) Source

Bases: NumdaplotError

Raised when a statistic that needs at least one value gets none.

Mean or Max cannot be computed on values that are all missing, or on no value at all.

Added in version 0.1.0

Parameters:

  • statistic_name (str)

    Name of the statistic.

Attributes:

  • statistic_name

    Name of the statistic.

Examples:

import numdaplot as ndp

array = ndp.Array.from_list([None, None], dtype=ndp.Type.FLOAT64)
try:
    array.compute(ndp.Mean())
except ndp.EmptyArrayError as error:
    print(error)
# Cannot compute Mean without any present value.