PyFixest
raw JSON → 0.50.1 verified Fri May 01 auth: no python
Fast high-dimensional fixed effect estimation library for Python, following the syntax of the R fixest package. Current version: 0.50.1. Released ~monthly. Supports OLS, GLM, IV, quantile regression, and robust/clustered inference with multiple demeaner backends (including Rust).
pip install pyfixest Common errors
error ImportError: cannot import name 'feols' from 'pyfixest' ↓
cause Old import path from internal modules; or pyfixest not installed.
fix
Use correct import: 'from pyfixest import feols' or 'import pyfixest as pf; pf.feols(...)'
error ValueError: The `vcov` argument must be a dict with keys 'CRV1', 'CRV3', or 'iid'. ↓
cause Passing a string like 'cluster' instead of dict.
fix
Use vcov={'CRV1': 'cluster_variable_name'}.
error TypeError: 'NoneType' object is not iterable when using demeaner_backend='rust-cg' ↓
cause Bug in v0.30.1 on Windows due to Rust ffi typing.
fix
Upgrade to >=0.30.2a or use different backend.
Warnings
breaking Default inference changed in v0.40.0: 'iid' is now default (previously it was cluster by first fixed effect). This replicates R fixest 0.13 behavior. Existing scripts that relied on clustered standard errors without explicitly specifying vcov will silently get different results. ↓
fix Set vcov='cluster' explicitly: feols(..., vcov={'CRV1': 'firm'})
deprecated The 'demean_backend' argument was renamed to 'demeaner_backend' in v0.50.0. Old argument still works but will be removed. ↓
fix Use 'demeaner_backend' instead of 'demean_backend'.
gotcha Formula handling changed in v0.50.0: the 'i()' operator for interactions now behaves differently. Old usage may break or yield unexpected results. ↓
fix Review the new formula syntax docs: https://pyfixest.org/formula.html
gotcha Windows users with Rust backend may encounter a TypeError in v0.30.2. Fixed in v0.30.2a. ↓
fix Upgrade to >=0.30.2a or use 'demeaner_backend='pyhdfe''.
Install
pip install 'pyfixest[dev]' Imports
- feols wrong
import pyfixest as pf; pf.feols(...)correctfrom pyfixest import feols - fepois wrong
from pyfixest.estimation import fepoiscorrectfrom pyfixest import fepois
Quickstart
import pandas as pd
from pyfixest import feols
# Load sample data
df = pd.read_csv('https://github.com/py-econometrics/pyfixest/raw/master/data/airbnb.csv')
# Estimate fixed effects model
fit = feols('price ~ distance | property_type', data=df)
print(fit.summary())