data-science-types
raw JSON → 0.2.23 verified Fri May 01 auth: no python maintenance
Type stubs for Python machine learning libraries such as pandas, numpy, matplotlib, and scikit-learn. Current version 0.2.23, requires Python >=3.6. Low release cadence.
pip install data-science-types Common errors
error Cannot find implementation or library stub for module 'pandas' ↓
cause Mypy cannot locate stub files; data-science-types may not be installed or is not being recognized.
fix
Run pip install data-science-types and ensure your mypy configuration includes packages.
error Missing type hints for pandas.DataFrame.groupby ↓
cause Stub coverage incomplete; data-science-types does not define all methods.
fix
Use pandas-stubs for more complete coverage, or add inline type hints with # type: ignore.
Warnings
gotcha The package does not provide stubs for all functions and may be incomplete. It is not actively maintained; consider migrating to typeshed stubs (pandas-stubs, numpy-stubs) instead. ↓
fix Install individual stub packages: pip install pandas-stubs numpy-stubs
deprecated data-science-types is in maintenance mode with infrequent updates. Newer pandas/numpy versions may have incomplete stub coverage. ↓
fix Use alternative stub packages like pandas-stubs, numpy-stubs, and scikit-learn-stubs.
Imports
- numpy
import numpy as np - pandas
import pandas as pd
Quickstart
import pandas as pd
import numpy as np
df = pd.DataFrame({'a': [1, 2, 3]})
reveal_type(df) # mypy will infer DataFrame type