pandas_lint is a static code analysis tool designed to help you write more efficient and readable Pandas and NumPy code. It detects common anti-patterns and performance bottlenecks, offering suggestions to improve your data processing pipelines.
- Performance Optimization: Identifies slow operations like
apply(), usage ofiterrows(), and inefficient string manipulations. - Best Practices: Enforces standard Pandas coding styles and conventions.
- Safety: Warns about potential issues like
SettingWithCopyWarningrisks and modification of views. - Easy Integration: Zero-config needed to get started, but fully configurable via
pyproject.toml.
You can install pandas_lint directly from PyPI:
pip install pandas-linterTo lint a file or directory:
pandas-lint path/to/your/script.py
pandas-lint path/to/your/project/To automatically fix issues where possible (experimental):
pandas-lint path/to/script.py --autofixYou can configure pandas_lint in your pyproject.toml file:
[tool.pandas-linter]
ignore = ["STY001", "PERF002"]We welcome contributions! Please see CONTRIBUTING.md for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.