NumPyInputOutput#

class pybrops.core.io.NumPyInputOutput.NumPyInputOutput[source]#

Bases: object

Abstract class for defining numpy.ndarray input/output functionality.

This abstract class defines two functions with the following purposes:

  • to_numpy - export an object to a numpy.ndarray.

  • from_numpy - load an object from a numpy.ndarray.

Methods

from_numpy

Read an object from a numpy.ndarray.

to_numpy

Export an object to a numpy.ndarray.

abstract classmethod from_numpy(arr, **kwargs)[source]#

Read an object from a numpy.ndarray.

Parameters:
  • arr (numpy.ndarray) – NumPy array from which to read.

  • kwargs (dict) – Additional keyword arguments to use for dictating importing from a numpy.ndarray.

Returns:

out – An object read from a numpy.ndarray.

Return type:

NumPyInputOutput

abstract to_numpy(**kwargs)[source]#

Export an object to a numpy.ndarray.

Parameters:

kwargs (dict) – Additional keyword arguments to use for dictating export to a numpy.ndarray.

Returns:

out – An output dataframe.

Return type:

numpy.ndarray