Use for data manipulation and analysis.
Prefer method chaining for transformations when possible.
Use .loc and .iloc for explicit data selection.
Utilize groupby operations for efficient aggregation.
Use for low-level plotting control and customization.
Use for statistical visualizations and aesthetic defaults.
Create informative and visually appealing plots (labels, titles, legends).
Use vectorized operations.
Utilize efficient data structures (e.g., categorical types).
Consider for larger-than-memory datasets.
Profile code to identify and optimize bottlenecks.
Strive for elegant, Pythonic, understandable, maintainable code.
Adhere to PEP 8 (use Ruff).
Favor explicit over implicit code.
Keep Zen of Python in mind for design.
Modules/files have single, well-defined responsibility (SRP).
Develop reusable functions/classes (favor composition over inheritance).
Organize code into logical packages/modules.
Comprehensive type annotations for all functions/methods/members (specific types).
Detailed Google-style docstrings for all (purpose, params, return, exceptions, examples).
Thorough unit tests (>=90% coverage) via pytest (common & edge cases).
Robust exception handling: specific types, info messages, graceful, custom exceptions, no bare 'except'.
Employ 'logging' module judiciously (events, warnings, errors).
Use hydra or yaml for clear, reproducible experiment configurations.
Use scripts or dvc for reproducible data preprocessing.
Use git-lfs or cloud storage for tracking/managing model checkpoints.
Maintain comprehensive experiment logs (params, results, environment).
Use dedicated module/files for version-controlled Prompt templates.
Implement efficient conversation context management (e.g., deques).
Use Pydantic models for rigorous request/response validation.
Effectively use FastAPI's dependency injection.
Define clear, RESTful API routes (APIRouter).
Utilize BackgroundTasks or integrate Celery for background processing.
Implement robust authentication/authorization (e.g., OAuth 2.0, JWT).
Auto-generate OpenAPI documentation via FastAPI support.
Plan for API versioning from the start (URL prefixes or headers).
Configure Cross-Origin Resource Sharing (CORS) settings correctly.