moderndid.core.panel.scan_gaps#

moderndid.core.panel.scan_gaps(data: Any, idname: str, tname: str) Any[source]#

Identify missing unit-time combinations.

Returns a DataFrame listing every unit-period pair that is absent from the data. Inspecting these gaps helps you decide whether to drop incomplete units with make_balanced_panel or fill them with null rows using fill_panel_gaps. For a quick Boolean check without materialising the gaps, use has_gaps.

Parameters:
dataDataFrame

Panel data. Accepts any object implementing the Arrow PyCapsule Interface (__arrow_c_stream__), including polars, pandas, pyarrow Table, and cudf DataFrames.

idnamestr

Unit identifier column.

tnamestr

Time period column.

Returns:
DataFrame

Rows with idname and tname columns for every absent pair, returned in the same format as data.

See also

has_gaps

Quick Boolean check for missing pairs.

fill_panel_gaps

Insert null rows for missing pairs.