inspect_panel¶
yohou.utils.panel.inspect_panel(df)
¶
Inspect DataFrame columns to distinguish global and local (panel) data.
Global columns apply to all time series (e.g., single univariate series or
features common across all panels). Local columns use the __ separator to
indicate panel data groups following the pattern
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Input DataFrame with potential mix of global and group columns. Must contain a "time" column (which is ignored in the output). |
required |
Returns¶
| Name | Type | Description |
|---|---|---|
global_names |
list of str
|
Names of columns without __ separator (excluding "time"). |
panel_groups |
dict of str to list of str
|
Mapping from group prefixes to their full column names. Example: {"store_1": ["store_1__sales", "store_1__returns"]} |
Examples¶
>>> import polars as pl
>>> # Global time series (single series)
>>> df_global = pl.DataFrame({"time": [1, 2, 3], "value": [10, 20, 30]})
>>> global_names, panel_groups = inspect_panel(df_global)
>>> global_names
['value']
>>> panel_groups
{}
>>> # Panel data with __ separator (<entity>__<variable>)
>>> df_panel = pl.DataFrame({
... "time": [1, 2, 3],
... "store_1__sales": [100, 110, 120],
... "store_2__sales": [150, 160, 170],
... })
>>> global_names, panel_groups = inspect_panel(df_panel)
>>> global_names
[]
>>> panel_groups
{'store_1': ['store_1__sales'], 'store_2': ['store_2__sales']}
See Also¶
select_panel_columns: Filter DataFrame to panel group columns and global columns
Source Code¶
Show/Hide source
Tutorials¶
The following example notebooks use this component:
-
How to Aggregate Scorer Results
Evaluation-Search
Demonstrate all scorer aggregation strategies (stepwise, vintagewise, componentwise, groupwise, coveragewise, all) on panel data with weighted group aggregation.
-
Panel Data Forecasting
Getting-Started
Forecast multiple related time series simultaneously using the __ naming convention, LocalPanelForecaster, and per-group scoring.
-
How to Configure LocalPanelForecaster
Panel-Data
Wrap any forecaster with LocalPanelForecaster for fully independent per-group clones, parallel fitting via n_jobs, and selective group operations.
-
How to Forecast Panel Prediction Intervals
Panel-Data
Combine conformal and quantile regression intervals on panel data with per-group coverage analysis, calibration plots, and groupwise interval scoring.
-
How to Preprocess Panel Data
Panel-Data
Automatic panel-aware transformation (StandardScaler, rolling stats, imputation) plus manual per-group workflows with get_group_df and dict_to_panel.
-
How to Apply Stationarity to Panel Data
Panel-Data
Apply per-group stationarity transforms on panel data with SeasonalDifferencing, DecompositionPipeline (polynomial trend + pattern seasonality), and residuals.
-
Quickstart
Quickstart
Comprehensive end-to-end tour of yohou beyond the Getting Started tutorials, covering data loading, baseline forecasting, preprocessing pipelines, decomposition, cross-validation search, and interval prediction.