causalis.data_contracts.panel_data_scm.TimeLikeTimeLike
None
Python Docs
causalis
Package entry
causalisRoot package overview and namespace mapNamespaces
causalis.data_contracts.panel_data_scmSubmodule causalis.data_contracts.panel_data_scm with no child pages and 22 documented members.
Classes
Jump directly into the documented classes for this page.
Data
Jump directly into the documented data for this page.
causalis.data_contracts.panel_data_scm.TimeLikeNone
causalis.data_contracts.panel_data_scm.PanelDataSCMBases: pydantic.BaseModel
Validated long-format panel contract for Synthetic Control estimators.
Required fields
df : pandas.DataFrame
Long-format panel data.
y : str
Outcome column name in df.
unit_col : str
Unit identifier column name in df.
time_col : str
Calendar time column name in df.
Preferred input format is pandas.Period values with a regular
frequency (for example monthly Period['M']). Datetime/string values
are accepted only when a regular frequency can be inferred.
treated_time : str
Binary treatment-assignment column in df (0/1 or False/True).
Notes
There are no optional contract fields. Extra keyword arguments are rejected.
The contract derives treated_unit, treatment_start, and time_freq
from the input data.
The model stores a validated internal dataframe snapshot used by all contract
methods; mutating the public df attribute after construction does not
affect validated contract behavior.
Outcome y must not contain null/NaN values. Represent missing panel
periods by omitting unit-time rows, not by keeping rows with NaN outcome.
For fiscal quarter/year semantics, pass time_col explicitly as
pandas.Period with the desired fiscal frequency.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Canonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM
Sections
causalis.data_contracts.panel_data_scm.PanelDataSCM.model_config‘ConfigDict(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.df‘Field(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.y‘Field(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.unit_col‘Field(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_col‘Field(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_time‘Field(…)’
causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_unitcausalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_startCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_freqcausalis.data_contracts.panel_data_scm.PanelDataSCM.n_pre_periodsCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.n_pre_periods
causalis.data_contracts.panel_data_scm.PanelDataSCM.n_post_periodsCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.n_post_periods
causalis.data_contracts.panel_data_scm.PanelDataSCM.last_post_periodCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.last_post_period
causalis.data_contracts.panel_data_scm.PanelDataSCM.donor_poolcausalis.data_contracts.panel_data_scm.PanelDataSCM.df_analysiscausalis.data_contracts.panel_data_scm.PanelDataSCM.pre_timescausalis.data_contracts.panel_data_scm.PanelDataSCM.post_timescausalis.data_contracts.panel_data_scm.PanelDataSCM.analysis_timesCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.analysis_times
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_to_indexCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_to_index
causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start_idxCanonical target
causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start_idx
causalis.data_contracts.panel_data_scm.PanelDataSCM.__repr__