PandasInputOutput#

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

Bases: object

Abstract class for defining pandas.DataFrame input/output functionality.

This abstract class defines two functions with the following purposes:

  • to_pandas - export an object to a pandas.DataFrame.

  • from_pandas - load an object from a pandas.DataFrame.

Methods

from_pandas

Read an object from a pandas.DataFrame.

to_pandas

Export an object to a pandas.DataFrame.

abstract classmethod from_pandas(df, **kwargs)[source]#

Read an object from a pandas.DataFrame.

Parameters:
  • df (pandas.DataFrame) – Pandas dataframe from which to read.

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

Returns:

out – An object read from a pandas.DataFrame.

Return type:

PandasInputOutput

abstract to_pandas(**kwargs)[source]#

Export an object to a pandas.DataFrame.

Parameters:

kwargs (dict) – Additional keyword arguments to use for dictating export to a pandas.DataFrame.

Returns:

out – An output dataframe.

Return type:

pandas.DataFrame