PyFixest is a Python package for fast high-dimensional fixed effects regression.
The package aims to mimic the syntax and functionality of Laurent Bergé's formidable fixest package as closely as Python allows. If you know fixest well, the goal is that you won't have to read the docs to get started! In particular, this means that all of fixest's defaults are mirrored by .
Multiple hypothesis corrections and simultaneous confidence intervals
Fast randomization inference
The causal cluster variance estimator (CCV)
Safe anytime-valid inference (SAVI) for sequential monitoring, with
anytime-valid p-values, e-values, and confidence sequences following
Lindon et al. (2026)
For visualization features using the lets-plot backend, install:
python -m pip install pyfixest[plots]
matplotlib is included by default, so plotting works without this extra.
To run the LSMR demeaner via PyTorch (CPU and GPU), you need to install PyTorch, which you can do via
python -m pip install pyfixest[torch]
For GPU acceleration on CUDA, you additionally need to install a CUDA-enabled torch build. See the PyTorch installation guide for details.
Then use the typed demeaner API:
# CPU
pf.feols(
"Y ~ X1 | f1 + f2",
data=data,
demeaner=pf.LsmrDemeaner(backend="torch", device="cpu"),
)
# CUDA GPU
pf.feols(
"Y ~ X1 | f1 + f2",
data=data,
demeaner=pf.LsmrDemeaner(backend="torch", device="cuda"),
)
import pyfixest as pf
data = pf.get_data()
pf.feols("Y ~ X1 | f1 + f2", data=data).summary()
The DGPs follow the "simple" and "difficult" designs from the fixest benchmarks. The figure timings for regressions with k=10 covariates and plots the median runtime across three runs for PyFixest MAP, PyFixest within, PyFixest torch on CUDA GPU, fixest, and FixedEffectModels.jl.
Runtime comparisons are hardware-dependent, especially for GPU backends. For the full benchmark suite, see the benchmarks/ directory and the note on difficult fixed effects problems.
For a full list of software packages and papers that have influenced PyFixest, please take a look at the Acknowledgements page.
We thank all institutions that have funded or supported work on PyFixest!
How to Cite
If you want to cite PyFixest, you can use the following BibTeX entry:
@software{pyfixest,
author = {{The PyFixest Authors}},
title = {{pyfixest: Fast high-dimensional fixed effect estimation in Python}},
year = {2025},
url = {https://github.com/py-econometrics/pyfixest}
}
Support PyFixest
If you enjoy using PyFixest, please consider donating to GiveDirectly and dedicating your donation to pyfixest.dev@gmail.com.
You can also leave a message through the donation form; your support and encouragement mean a lot to the developers.
Call for Contributions
Thanks for showing interest in contributing to pyfixest! We appreciate all
contributions and constructive feedback, whether that be reporting bugs, requesting
new features, or suggesting improvements to documentation.
If you'd like to get involved, but are not yet sure how, please feel free to send us an email. Some familiarity with
either Python or econometrics will help, but you really don't need to be a numpy core developer or have published in Econometrica =) We'd be more than happy to invest time to help you get started!