Skip to content

bagof.converters.pandas

Converters for pandas types.

Classes

ToDataFrame

ToDataFrame(hint: Any = UNSET, compose: bool = False)

Bases: Converter[Any, Any]

Converter for [pandas.DataFrame][].

Note

An existing frame is returned unchanged (the inherited __call__ passes instances of the target type through rather than rebuilding them, so a real frame is never needlessly copied); anything else is passed to the [pandas.DataFrame][] constructor.

Methods:

like
like(__reentrant: tuple = ()) -> Any

A frame, a mapping of columns, or an iterable of rows.

ToSeries

ToSeries(hint: Any = UNSET, compose: bool = False)

Bases: Converter[Any, Any]

Converter for [pandas.Series][].

Like ToDataFrame, an existing series is passed through unchanged; anything else goes to the [pandas.Series][] constructor.

Methods:

like
like(__reentrant: tuple = ()) -> Any

A series, an iterable of values, or a mapping.