nominal#

named_arrays.nominal(a)#

Isolate the nominal attribute of an uncertain array. If a is a nested object, such a vector, this function is recursively applied to all the attributes of the nested object.

Parameters:

a (AnyT | UncertainScalarArray[NominalArrayT, DistributionArrayT]) – An array to isolate the nominal attribute of.

Return type:

AnyT | NominalArrayT

Examples

If we define an uncertain scalar x,

import named_arrays as na

x = na.UniformUncertainScalarArray(5, 4, num_distribution=5).explicit
x
UncertainScalarArray(
    nominal=5,
    distribution=ScalarArray(
        ndarray=[2.69788248, 1.29802478, 4.30274133, 8.62366084, 5.65637916],
        axes=('_distribution',),
    ),
)

then we can isolate the nominal attribute of x using this function

na.nominal(x)
5

If we use this scalar to define a vector a,

a = na.Cartesian2dVectorArray(x, 2)
a
Cartesian2dVectorArray(
    x=UncertainScalarArray(
        nominal=5,
        distribution=ScalarArray(
            ndarray=[2.69788248, 1.29802478, 4.30274133, 8.62366084, 5.65637916],
            axes=('_distribution',),
        ),
    ),
    y=2,
)

then we can also isolate the nominal attribute of every component of a

na.nominal(a)
Cartesian2dVectorArray(x=5, y=2)