openmnglab.datamodel.pandas.model.PandasInputDataScheme#
- class openmnglab.datamodel.pandas.model.PandasInputDataScheme(schema: TPandasScheme)[source]#
Bases:
Generic[TPandasScheme],PandasDataScheme[TPandasScheme],IInputDataScheme- __init__(schema: TPandasScheme)#
Methods
__init__(schema)accepts(output_data_scheme)Assess whether this scheme would accept the other data scheme as input.
transform(data_container)Transform a data container to fit this scheme
Attributes
pandera_schema- accepts(output_data_scheme: IOutputDataScheme) bool[source]#
Assess whether this scheme would accept the other data scheme as input.
If the schemes are incompatible, the function may either raise an exception containing further details on why the other data scheme is not accepted as input or just return
False- Raises:
DataSchemeCompatibilityError – If the data schemes are not compatible and further details are available
- Parameters:
output_data_scheme – Output data scheme to check for compatibility
- Returns:
Trueif the output data scheme is accepted as input,Falseotherwise
- transform(data_container: IDataContainer) IDataContainer[source]#
Transform a data container to fit this scheme
Modifies the contents of the data container so they fit an anonymous data scheme which is actually accepted by the function. MAY return the input-object without modification.
- Parameters:
data_container – Data container containing the data which is expected to be passed to this function
- Returns:
A modified dataset from the input data container or the same object