DataFrameSchema

class lsst.daf.butler.formatters.parquet.DataFrameSchema(dataframe: pd.DataFrame)

Bases: object

Wrapper class for a schema for a pandas DataFrame.

Parameters:
dataframepandas.DataFrame

Dataframe to turn into a schema.

Attributes Summary

schema

Methods Summary

from_arrow(schema)

Convert an arrow schema into a DataFrameSchema.

to_arrow_astropy_schema()

Convert to an ArrowAstropySchema.

to_arrow_numpy_schema()

Convert to an ArrowNumpySchema.

to_arrow_schema()

Convert to an arrow schema.

Attributes Documentation

schema

Methods Documentation

classmethod from_arrow(schema: Schema) DataFrameSchema

Convert an arrow schema into a DataFrameSchema.

Parameters:
schemapyarrow.Schema

The pyarrow schema to convert.

Returns:
dataframe_schemaDataFrameSchema

Converted dataframe schema.

to_arrow_astropy_schema() ArrowAstropySchema

Convert to an ArrowAstropySchema.

Returns:
arrow_astropy_schemaArrowAstropySchema

Converted arrow astropy schema.

to_arrow_numpy_schema() ArrowNumpySchema

Convert to an ArrowNumpySchema.

Returns:
arrow_numpy_schemaArrowNumpySchema

Converted arrow numpy schema.

to_arrow_schema() Schema

Convert to an arrow schema.

Returns:
arrow_schemapyarrow.Schema

Converted pyarrow schema.