pandera.typing.DataFrame¶
- class pandera.typing.DataFrame(data=None, index=None, columns=None, dtype=None, copy=None)[source]¶
A generic type for pandas.DataFrame.
new in 0.5.0
Attributes
TThe transpose of the DataFrame.
atAccess a single value for a row/column label pair.
attrsDictionary of global attributes of this dataset.
axesReturn a list representing the axes of the DataFrame.
columnsThe column labels of the DataFrame.
default_dtypedtypesReturn the dtypes in the DataFrame.
emptyIndicator whether Series/DataFrame is empty.
flagsGet the properties associated with this pandas object.
iatAccess a single value for a row/column pair by integer position.
ilocPurely integer-location based indexing for selection by position.
indexThe index (row labels) of the DataFrame.
locAccess a group of rows and columns by label(s) or a boolean array.
ndimReturn an int representing the number of axes / array dimensions.
shapeReturn a tuple representing the dimensionality of the DataFrame.
sizeReturn an int representing the number of elements in this object.
styleReturns a Styler object.
valuesReturn a Numpy representation of the DataFrame.
Methods
- classmethod from_format(obj, config)[source]¶
Converts serialized data from a specific format specified in the
pandera.api.pandas.model.DataFrameModelconfig optionsfrom_formatandfrom_format_kwargs.
- static from_records(schema, data, **kwargs)[source]¶
Convert structured or record ndarray to pandera-validated DataFrame.
Creates a DataFrame object from a structured ndarray, sequence of tuples or dicts, or DataFrame.
See pandas.DataFrame.from_records for more details.
- Return type:
DataFrame[~DataFrameModel]
- classmethod pydantic_validate(obj, schema_model)[source]¶
Verify that the input can be converted into a pandas dataframe that meets all schema requirements.
This is for pydantic >= v2
- Return type:
- classmethod to_format(data, config)[source]¶
Converts a dataframe to the format specified in the
pandera.api.pandas.model.DataFrameModelconfig optionsto_formatandto_format_kwargs.