pivot_sources

pivot_sources(anchored)

Turn one anchored row per source into one row per subject.

Methods read a subject at a time: the forecast, the consensus and, when it exists, the actual, side by side. The long format is what callers hold and what anchoring consumes; this is the shape a method sees.

Parameters

Name Type Description Default
anchored pd.DataFrame One row per subject and source, as anchoring returns. required

Returns

Name Type Description
pd.DataFrame One row per subject, with a value column per source and suffixed known_at, dispersion and estimate_count columns when present.

Raises

Name Type Description
PanelError The same subject and source appears more than once, or source names collide with identifiers or generated columns.