latest_before

latest_before(estimates, as_of, *, maximum_age=None, inclusive=False)

Return each source’s latest estimate per subject as of one moment.

Parameters

Name Type Description Default
estimates pd.DataFrame Validated long input panel. required
as_of pd.Timestamp UTC-aware reading moment; invalid values raise PanelError. required
maximum_age pd.Timedelta | None Discard an estimate older than this at as_of. None keeps every estimate, however stale. Invalid durations raise PanelError. None
inclusive bool Keep an estimate whose known_at equals as_of. False is the default because an event’s own timestamp is the common as_of, and a value knowable at that instant is the value under study. False

Returns

Name Type Description
pd.DataFrame One row per subject and source, carrying that source’s most recent value and the known_at it was published at. Empty when nothing qualifies.