Here's a utility for measuring pandas' type-completeness.
Usage:
- Make sure you have Python3.12 installed
python3.12 -m venv .venv. I'd suggest not usinguv, becauseuvdoes some clever caching, and here you'll be adding files to your local site packages.- Clone
pandas-stubsfromhttps://github.com/pandas-dev/pandas-stubs - Install pandas nightly. See https://pandas.pydata.org/docs/getting_started/install.html for how to do that.
- Run
python inline_pandas_stubs.pywith your virtual environment activated. - Install
pyright,polars, andmarimointo your virtual environment. - Run
git clone https://github.com/pandas-dev/pandas.git pandas-dev --depth=1 - Run
python list_public_methods.py. This will generatepublic_methods.csvwith the public methods from the pandas API. - Run
pyright --verifytypes pandas --ignoreexternal --outputjson > type_report.json - Run
marimo edit analysis.py.
At the end of the Marimo notebook, there's a cell showing which public functions in pandas has missing types.
Limitations:
- StringMethods (e.g.
Series.str.upper) are incorrectly flagged as "type unknown"