first_known

first_known(observations, *, key_columns, known_at_column=KNOWN_AT_COLUMN)

Keep the first-known observation per key, dropping every later revision.

The first report of a figure is the one a market could trade on. A later restatement is a different fact and must not displace it.

Parameters

Name Type Description Default
observations pd.DataFrame Point-in-time rows, possibly several per key. required
key_columns Sequence[str] Columns identifying one figure. required
known_at_column str Column holding when each row became knowable. KNOWN_AT_COLUMN

Returns

Name Type Description
pd.DataFrame One row per key: the one with the earliest known_at.

Raises

Name Type Description
PanelError A column is absent or known_at is not tz-aware UTC.