Skip to content

Library Source

Bases: Enum

Underlying library on the other side of a type conversion, read on UnsupportedTypeError.library.

The value of each member is the name of the library, as shown in error messages.

Added in version 0.1.0

Examples:

import numdaplot as ndp
import numpy

try:
    ndp.Array.from_numpy(numpy.array([1 + 2j]))
except ndp.UnsupportedTypeError as error:
    print(error.library.value)
# numpy

Attributes

NUMPY = 'numpy' Source

numpy, used by Array.

Added in version 0.1.0

Examples:

import numdaplot as ndp
import numpy

try:
    ndp.Array.from_numpy(numpy.array([1 + 2j]))
except ndp.UnsupportedTypeError as error:
    print(error.library == ndp.Library.NUMPY)
# True

PANDAS = 'pandas' Source

pandas, used by Table.

Added in version 0.1.0

Examples:

import numdaplot as ndp
import pandas

try:
    ndp.Table.from_pandas(pandas.DataFrame({"impedance": [1 + 2j]}))
except ndp.UnsupportedTypeError as error:
    print(error.library == ndp.Library.PANDAS)
# True