age_at

age_at(subjects, as_of)

Add a source’s staleness, as a value, beside each source’s known_at.

Staleness has to reach a method as a value, not as rows quietly dropped by latest_before’s maximum_age. Filtering it upstream would make a stale prediction indistinguishable from a missing one downstream.

Parameters

Name Type Description Default
subjects pd.DataFrame One row per subject, with a _known_at column per source, as pivot_sources produces. required
as_of pd.Timestamp UTC-aware reading moment; invalid values raise PanelError. required

Returns

Name Type Description
pd.DataFrame A copy of subjects with one _age column per _known_at column, holding as_of minus known_at. NaT in, NaT out.