Skip to content

BaseDataFrame

The common base of every typed dataframe (TrajDataFrame, Positionfixes, Staypoints, Locations, Triplegs, Trips, Tours, FlowDataFrame). It gives them conversion to the native dataframe, a metric comparison with another table and the chart builders of the optional fastmob[vis] extra.

Catalogue

API Description Example
BaseDataFrame Small wrapper around an eager dataframe backend. Convert and compare typed tables
BaseDataFrame.compare_to Compare value_col against other, optionally grouped by group_col. Convert and compare typed tables
BaseDataFrame.plot_bar Build a categorical bar chart from existing columns. Chart the results
BaseDataFrame.plot_boxplot Build a box plot from existing long-form columns. Chart the results
BaseDataFrame.plot_ecdf Build an ECDF chart for an existing numeric or list-valued column. Chart the results
BaseDataFrame.plot_heatmap Build a long-form heatmap from existing columns. Chart the results
BaseDataFrame.plot_scatter Build a scatter chart from existing columns. Chart the results
BaseDataFrame.to_native Return the stored native dataframe (a PyArrow table for tables built by the library's own readers). Convert and compare typed tables
BaseDataFrame.to_pandas Return the wrapped data as a native pandas DataFrame. Load the data
BaseDataFrame.to_polars Return the wrapped data as a native Polars DataFrame. Convert and compare typed tables

BaseDataFrame

Small wrapper around an eager dataframe backend.

compare_to(other, value_col, *, group_col=None, metric=None)

Compare value_col against other, optionally grouped by group_col.

See fastmob.measures.evaluation.compare.compare_to.

plot_bar(*, category_col, value_col, **kwargs)

Build a categorical bar chart from existing columns.

plot_boxplot(*, category_col, value_col, **kwargs)

Build a box plot from existing long-form columns.

plot_ecdf(value_col, *, second=None, **kwargs)

Build an ECDF chart for an existing numeric or list-valued column.

Requires the optional fastmob[vis] extra. second may be another Fastmob dataframe wrapper or an eager dataframe with the same column.

plot_heatmap(*, x_col, y_col, value_col, **kwargs)

Build a long-form heatmap from existing columns.

plot_scatter(*, x_col, y_col, **kwargs)

Build a scatter chart from existing columns.

to_native()

Return the stored native dataframe (a PyArrow table for tables built by the library's own readers).

to_pandas()

Return the wrapped data as a native pandas DataFrame.

to_polars()

Return the wrapped data as a native Polars DataFrame.

Worked example: Convert and compare typed tables · Chart the results · Load the data