.to_df().
Verbs
Match aliases
starts_with / start with, exactly / exactly match, contain, end with.
Gap semantics
gap_days uses consecutive distinct-date gaps (lead()), not span. See Which API?.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
EventFrame verbs for matching, occurrence, gaps, and index dates.
.to_df().
index = (
db.diagnosis
.matching("E11", code_type="10", match="starts_with")
.occurring(at_least=2, gap_days=30)
.with_index_date()
.first_per_patient()
)
| Verb | Meaning |
|---|---|
matching(codes, code_type=…, match=…) | Filter by code / type / match mode |
in_position("primary") | Primary / secondary diagnosis |
occurring(at_least=…, at_most=…, gap_days=…) | Patient-level occurrence + consecutive gaps |
with_index_date() | Add index_date |
first_per_patient() / last_per_patient() | One row per patient |
between(...) / in_years(...) | Calendar filters |
with_age(...) / with_followup(...) | Attach derived columns |
union(other) | Stack event streams |
label("name") | Name a step for repr / attrition |
to_sql() / to_df() / explain() | Inspect / run |
starts_with / start with, exactly / exactly match, contain, end with.
gap_days uses consecutive distinct-date gaps (lead()), not span. See Which API?.