Skip to content

IrregularListError() Source

Bases: NumdaplotError

Raised when nested lists do not form a regular block of rows and columns.

The lists at one level have different lengths, or mix lists and single values.

Added in version 0.1.0

Examples:

import numdaplot as ndp

try:
    ndp.Array.from_list([[1, 2], [3]])
except ndp.IrregularListError as error:
    print(error)
# Expected nested lists of equal lengths.