Skip to content
Submodule
causalis.data_contracts.panel_data_scm

panel_data_scm

Submodule causalis.data_contracts.panel_data_scm with no child pages and 22 documented members.

Classes

Jump directly into the documented classes for this page.

1 items

Data

Jump directly into the documented data for this page.

1 items
data
causalis.data_contracts.panel_data_scm.TimeLike

TimeLike

Value: None

None

Canonical target

causalis.data_contracts.panel_data_scm.TimeLike

Link to this symbol
class
causalis.data_contracts.panel_data_scm.PanelDataSCM

PanelDataSCM

Bases: 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

Required fieldsNotesInitialization
Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.model_config

model_config

Value: 'ConfigDict(...)'

‘ConfigDict(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.model_config

Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.df

df

Value: 'Field(...)'

‘Field(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.df

Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.y

y

Value: 'Field(...)'

‘Field(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.y

Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.unit_col

unit_col

Value: 'Field(...)'

‘Field(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.unit_col

Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_col

time_col

Value: 'Field(...)'

‘Field(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.time_col

Link to this symbol
attribute
causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_time

treated_time

Value: 'Field(...)'

‘Field(…)’

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_time

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_unit

treated_unit

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.treated_unit

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start

treatment_start

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_freq

time_freq

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.time_freq

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.n_pre_periods

n_pre_periods

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.n_pre_periods

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.n_post_periods

n_post_periods

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.n_post_periods

Link to this symbol
property
causalis.data_contracts.panel_data_scm.PanelDataSCM.last_post_period

last_post_period

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.last_post_period

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.donor_pool

donor_pool

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.donor_pool

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.df_analysis

df_analysis

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.df_analysis

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.pre_times

pre_times

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.pre_times

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.post_times

post_times

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.post_times

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.analysis_times

analysis_times

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.analysis_times

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.time_to_index

time_to_index

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.time_to_index

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start_idx

treatment_start_idx

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.treatment_start_idx

Link to this symbol
method
causalis.data_contracts.panel_data_scm.PanelDataSCM.__repr__

__repr__

Canonical target

causalis.data_contracts.panel_data_scm.PanelDataSCM.__repr__

Link to this symbol