probly.representation.array_like.NumpyArrayLikeImplementation

class probly.representation.array_like.NumpyArrayLikeImplementation(*args, **kwargs)[source]

Bases: ArrayLike, NDArrayOperatorsMixin, ABC, Generic

ABC implementation for array-like objects that behave like NumPy arrays.

property T: Self

The transposed version of the underlying array.

astype(dtype: DTypeLike, order: Order = 'K', casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = 'unsafe', subok: bool = True, copy: bool = True) Self[source]

Copy of the array, cast to a specified type.

copy(order: Order = 'C') Self[source]

Return a copy of the array.

property device: Any

Device of the array.

abstract property dtype: dtype

Data type of the array.

abstract property flags: ArrayFlagsLike

The flags of the array.

property mT: Self

The transposed version of the underlying array.

property ndim: int

Number of dimensions.

property shape: tuple[int, ...]

Shape of the array.

property size: int

Number of elements in the array.

to_device(device: Any, /, *, stream: Any = None) Self[source]

Move the array to a device.

transpose(*axes: int | None) Self[source]

Return a transposed version of the ArraySample.

This method implicitly also provides full axis tracking support for - np.moveaxis - np.rollaxis Those functions call out to transpose methods for custom array types.

Parameters:

axes – The axes to transpose.

Returns:

A transposed version of the ArraySample.

Examples using probly.representation.array_like.NumpyArrayLikeImplementation

Plotting binary credal sets on an interval

Plotting binary credal sets on an interval

Plotting credal sets on the simplex

Plotting credal sets on the simplex

Plotting credal sets on a spider (radar) chart

Plotting credal sets on a spider (radar) chart

Convex credal set

Convex credal set

Discrete credal set

Discrete credal set

Distance-based credal set

Distance-based credal set

Probability-intervals credal set

Probability-intervals credal set

Working with ArraySample

Working with ArraySample

Singleton credal set

Singleton credal set