ndarray Module¶
This section documents the NumPy ndarray utilities of the nextmv-scikit-learn package.
ndarray
¶
NumPy ndarray wrapper for Pydantic model integration.
This module provides utilities to handle NumPy arrays in Pydantic models.
Variables
ndarray : Annotated A type annotation for NumPy arrays in Pydantic models.
ndarray
module-attribute
¶
ndarray: An annotated type that represents a NumPy array.
You can import the ndarray
type directly from nextmv_sklearn
:
This type is designed for use with Pydantic models to properly handle NumPy arrays for validation and serialization.
The BeforeValidator ensures the input is preserved as is, while PlainSerializer converts the ndarray to a Python list when serializing.
Examples: