
python-panel-data
Panel data analysis with Python using linearmodels and pandas.
- Installs
- 155
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill python-panel-data- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads python-panel-data automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Python Panel Data
Purpose
This skill helps economists run panel data models in Python using pandas, statsmodels, and linearmodels, with correct fixed effects, clustering, and diagnostics.
When to Use
- Estimating fixed effects or random effects models
- Running difference-in-differences on panel data
- Creating regression tables and plots in Python
Instructions
Follow these steps to complete the task:
Step 1: Understand the Context
Before generating any code, ask the user:
- What is the unit of observation and panel identifiers?
- Which outcomes and regressors are required?
- What fixed effects or time effects are needed?
- How should standard errors be clustered?
Step 2: Generate the Output
Based on the context, generate Python code that:
- Loads and cleans the data with
pandas - Sets a MultiIndex for panel structure
- Fits the model using
linearmodels.PanelOLSorRandomEffects - Outputs results in a readable table and optional LaTeX
Step 3: Verify and Explain
After generating output:
- Interpret key coefficients
- Note assumptions (strict exogeneity, parallel trends, etc.)
- Suggest robustness checks (alternative clustering, placebo tests)
Example Prompts
- "Run a two-way fixed effects model with firm and year effects"
- "Estimate a DiD using state and year fixed effects"
- "Export panel regression results to LaTeX"
Example Output
# ============================================
# Panel Data Analysis in Python
# ============================================
import pandas as pd
from linearmodels.panel import PanelOLS
# Load data
df = pd.read_csv("panel_data.csv")
# Set panel index
df = df.set_index(["firm_id", "year"])
# Create treatment indicator
df["treat_post"] = df["treated"] * df["post"]
# Two-way fixed effects model
model = PanelOLS.from_formula(
"outcome ~ 1 + treat_post + EntityEffects + TimeEffects",
data=df
)
results = model.fit(cov_type="clustered", cluster_entity=True)
print(results.summary)
Requirements
Software
- Python 3.10+
Packages
pandaslinearmodelsstatsmodels
Install with:
pip install pandas linearmodels statsmodels
Best Practices
- Always verify panel identifiers and balanced vs unbalanced panels
- Cluster standard errors at the appropriate level
- Check for missing data before estimation
Common Pitfalls
- Failing to set a proper panel index
- Using pooled OLS when fixed effects are required
- Misinterpreting coefficients without accounting for fixed effects
References
- linearmodels documentation
- statsmodels documentation
- Wooldridge (2010) Econometric Analysis of Cross Section and Panel Data
Changelog
v1.0.0
- Initial release
FAQ
What does the python-panel-data skill do?
Panel data analysis with Python using linearmodels and pandas.
How do I install python-panel-data?
Run npx skills add https://github.com/meleantonio/awesome-econ-ai-stuff --skill python-panel-data in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/python-panel-data/ (personal) or .claude/skills/python-panel-data/ (project).
Which AI agents can use python-panel-data?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is python-panel-data safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains python-panel-data?
It is published by meleantonio in meleantonio/awesome-econ-ai-stuff. It has 155 recorded installs.
More from meleantonio/awesome-econ-ai-stuff
academic-paper-writer
meleantonio/awesome-econ-ai-stuff
Draft economics papers with proper structure and academic style
stata-regression
meleantonio/awesome-econ-ai-stuff
Run regression analyses in Stata with publication-ready output tables.
stata-data-cleaning
meleantonio/awesome-econ-ai-stuff
Clean and transform messy data in Stata with reproducible workflows
r-econometrics
meleantonio/awesome-econ-ai-stuff
Run IV, DiD, and RDD analyses in R with proper diagnostics
beamer-presentation
meleantonio/awesome-econ-ai-stuff
Create academic presentations in Beamer with professional themes
lit-review-assistant
meleantonio/awesome-econ-ai-stuff
Search, summarize, and synthesize economics literature
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.