acore.types.differential_analysis module#
- class AnovaSchema(*args, **kwargs)[source]#
Bases:
DataFrameModelSchema for the enrichment analysis results DataFrame.
- class Config#
Bases:
BaseConfig- dtype: str | type | DataType | ExtensionDtype | dtype | None = None#
datatype of the dataframe. This overrides the data types specified in any of the fields.
- from_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format before validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, assumes a data structure compatible with thepandas.DataFrameconstructor.
- from_format_kwargs: dict[str, Any] | None = None#
a dictionary keyword arguments to pass into the reader function that converts the object of type
from_formatto a pandera-validate-able data structure. The reader function is implemented in the pandera.typing generic types via thefrom_formatandto_formatmethods.
- multiindex_strict: bool | Literal['filter'] = False#
make sure all specified columns are in validated MultiIndex - if
"filter", removes indexes not specified in the schema
- multiindex_unique = None#
make sure the MultiIndex is unique along the list of columns
- strict: bool | Literal['filter'] = False#
make sure all specified columns are in the validated dataframe - if
"filter", removes columns not specified in the schema
- to_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format to serialize into after validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, returns a dataframe.
- to_format_buffer: str | Callable | None = None#
Buffer to be provided when to_format is a custom callable. See docs for example of how to implement an example of a to format function.
- classmethod build_schema_(**kwargs) DataFrameSchema#
- classmethod example(**kwargs) DataFrameBase[Self]#
Generate an example of this data model specification.
- classmethod from_json(source)#
Load a schema from JSON.
- Parameters:
source – str, Path, or file stream with JSON content.
- Returns:
the backend-specific schema object.
- classmethod from_yaml(yaml_schema)#
Load a schema from YAML.
- Parameters:
yaml_schema – str, Path, or file stream with YAML content.
- Returns:
the backend-specific schema object.
- classmethod pydantic_validate(schema_model: Any) DataFrameModel#
Verify that the input is a compatible dataframe model.
- classmethod strategy(**kwargs)#
Create a data synthesis strategy.
- classmethod to_json_schema()#
Serialize schema metadata into json-schema format.
- Parameters:
dataframe_schema – schema to write to json-schema format.
Note
This function is currently does not fully specify a pandera schema, and is primarily used internally to render OpenAPI docs via the FastAPI integration.
- classmethod to_schema() TSchema#
Create
DataFrameSchemafrom theDataFrameModel.
- classmethod validate(check_obj: DataFrame, head: int | None = None, tail: int | None = None, sample: int | None = None, random_state: int | None = None, lazy: bool = False, inplace: bool = False) DataFrame[Self]#
Validate a DataFrame based on the schema specification.
- Parameters:
check_obj (pd.DataFrame) – the dataframe to be validated.
head – validate the first n rows. Rows overlapping with tail or sample are de-duplicated.
tail – validate the last n rows. Rows overlapping with head or sample are de-duplicated.
sample – validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.
random_state – random seed for the
sampleargument.lazy – if True, lazily evaluates dataframe against all validation checks and raises a
SchemaErrors. Otherwise, raiseSchemaErroras soon as one occurs.inplace – if True, applies coercion to the object of validation, otherwise creates a copy of the data.
- Returns:
validated
DataFrame- Raises:
SchemaError – when
DataFrameviolates built-in or custom checks.
- class AnovaSchemaMultiGroup(*args, **kwargs)[source]#
Bases:
AnovaSchemaSchema for more than two groups
- class Config#
Bases:
Config- dtype: str | type | DataType | ExtensionDtype | dtype | None = None#
datatype of the dataframe. This overrides the data types specified in any of the fields.
- from_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format before validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, assumes a data structure compatible with thepandas.DataFrameconstructor.
- from_format_kwargs: dict[str, Any] | None = None#
a dictionary keyword arguments to pass into the reader function that converts the object of type
from_formatto a pandera-validate-able data structure. The reader function is implemented in the pandera.typing generic types via thefrom_formatandto_formatmethods.
- multiindex_strict: bool | Literal['filter'] = False#
make sure all specified columns are in validated MultiIndex - if
"filter", removes indexes not specified in the schema
- multiindex_unique = None#
make sure the MultiIndex is unique along the list of columns
- strict: bool | Literal['filter'] = False#
make sure all specified columns are in the validated dataframe - if
"filter", removes columns not specified in the schema
- to_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format to serialize into after validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, returns a dataframe.
- to_format_buffer: str | Callable | None = None#
Buffer to be provided when to_format is a custom callable. See docs for example of how to implement an example of a to format function.
- classmethod build_schema_(**kwargs) DataFrameSchema#
- classmethod example(**kwargs) DataFrameBase[Self]#
Generate an example of this data model specification.
- classmethod from_json(source)#
Load a schema from JSON.
- Parameters:
source – str, Path, or file stream with JSON content.
- Returns:
the backend-specific schema object.
- classmethod from_yaml(yaml_schema)#
Load a schema from YAML.
- Parameters:
yaml_schema – str, Path, or file stream with YAML content.
- Returns:
the backend-specific schema object.
- classmethod pydantic_validate(schema_model: Any) DataFrameModel#
Verify that the input is a compatible dataframe model.
- classmethod strategy(**kwargs)#
Create a data synthesis strategy.
- classmethod to_json_schema()#
Serialize schema metadata into json-schema format.
- Parameters:
dataframe_schema – schema to write to json-schema format.
Note
This function is currently does not fully specify a pandera schema, and is primarily used internally to render OpenAPI docs via the FastAPI integration.
- classmethod to_schema() TSchema#
Create
DataFrameSchemafrom theDataFrameModel.
- classmethod validate(check_obj: DataFrame, head: int | None = None, tail: int | None = None, sample: int | None = None, random_state: int | None = None, lazy: bool = False, inplace: bool = False) DataFrame[Self]#
Validate a DataFrame based on the schema specification.
- Parameters:
check_obj (pd.DataFrame) – the dataframe to be validated.
head – validate the first n rows. Rows overlapping with tail or sample are de-duplicated.
tail – validate the last n rows. Rows overlapping with head or sample are de-duplicated.
sample – validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.
random_state – random seed for the
sampleargument.lazy – if True, lazily evaluates dataframe against all validation checks and raises a
SchemaErrors. Otherwise, raiseSchemaErroras soon as one occurs.inplace – if True, applies coercion to the object of validation, otherwise creates a copy of the data.
- Returns:
validated
DataFrame- Raises:
SchemaError – when
DataFrameviolates built-in or custom checks.
- class AncovaSchema(*args, **kwargs)[source]#
Bases:
DataFrameModelSchema for the enrichment analysis results DataFrame.
- class Config#
Bases:
BaseConfig- dtype: str | type | DataType | ExtensionDtype | dtype | None = None#
datatype of the dataframe. This overrides the data types specified in any of the fields.
- from_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format before validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, assumes a data structure compatible with thepandas.DataFrameconstructor.
- from_format_kwargs: dict[str, Any] | None = None#
a dictionary keyword arguments to pass into the reader function that converts the object of type
from_formatto a pandera-validate-able data structure. The reader function is implemented in the pandera.typing generic types via thefrom_formatandto_formatmethods.
- multiindex_strict: bool | Literal['filter'] = False#
make sure all specified columns are in validated MultiIndex - if
"filter", removes indexes not specified in the schema
- multiindex_unique = None#
make sure the MultiIndex is unique along the list of columns
- strict: bool | Literal['filter'] = False#
make sure all specified columns are in the validated dataframe - if
"filter", removes columns not specified in the schema
- to_format: Literal[Formats.csv] | Literal[Formats.dict] | Literal[Formats.json] | Literal[Formats.feather] | Literal[Formats.parquet] | Literal[Formats.pickle] | Literal[Formats.json_normalize] | Callable | None = None#
data format to serialize into after validation. This option only applies to schemas used in the context of the pandera type constructor
pa.typing.DataFrame[Schema](data). If None, returns a dataframe.
- to_format_buffer: str | Callable | None = None#
Buffer to be provided when to_format is a custom callable. See docs for example of how to implement an example of a to format function.
- classmethod build_schema_(**kwargs) DataFrameSchema#
- classmethod example(**kwargs) DataFrameBase[Self]#
Generate an example of this data model specification.
- classmethod from_json(source)#
Load a schema from JSON.
- Parameters:
source – str, Path, or file stream with JSON content.
- Returns:
the backend-specific schema object.
- classmethod from_yaml(yaml_schema)#
Load a schema from YAML.
- Parameters:
yaml_schema – str, Path, or file stream with YAML content.
- Returns:
the backend-specific schema object.
- classmethod pydantic_validate(schema_model: Any) DataFrameModel#
Verify that the input is a compatible dataframe model.
- classmethod strategy(**kwargs)#
Create a data synthesis strategy.
- classmethod to_json_schema()#
Serialize schema metadata into json-schema format.
- Parameters:
dataframe_schema – schema to write to json-schema format.
Note
This function is currently does not fully specify a pandera schema, and is primarily used internally to render OpenAPI docs via the FastAPI integration.
- classmethod to_schema() TSchema#
Create
DataFrameSchemafrom theDataFrameModel.
- classmethod validate(check_obj: DataFrame, head: int | None = None, tail: int | None = None, sample: int | None = None, random_state: int | None = None, lazy: bool = False, inplace: bool = False) DataFrame[Self]#
Validate a DataFrame based on the schema specification.
- Parameters:
check_obj (pd.DataFrame) – the dataframe to be validated.
head – validate the first n rows. Rows overlapping with tail or sample are de-duplicated.
tail – validate the last n rows. Rows overlapping with head or sample are de-duplicated.
sample – validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.
random_state – random seed for the
sampleargument.lazy – if True, lazily evaluates dataframe against all validation checks and raises a
SchemaErrors. Otherwise, raiseSchemaErroras soon as one occurs.inplace – if True, applies coercion to the object of validation, otherwise creates a copy of the data.
- Returns:
validated
DataFrame- Raises:
SchemaError – when
DataFrameviolates built-in or custom checks.