Jupyter Notebook taste — промпт для ChatGPT: установка и правила
Промпт Jupyter Notebook taste для ChatGPT задаёт правила воспроизводимых Jupyter-ноутбуков. Он включается при подготовке анализа к ревью или коммиту.
CC0-1.0 ★ 178 201 обновлён 2026-10-24
Открыть на GitHubЧто делает Jupyter Notebook taste
Промпт Jupyter Notebook taste задаёт правила для ноутбуков, которые запускаются сверху вниз после «Restart and Run All». Импорты, настройки, константы и случайные seed-значения собраны в первых ячейках, а повторно используемая логика вынесена в Python-пакет. Во время разработки пакета предлагается применять %load_ext autoreload и %autoreload 2.
Правила охватывают lock-файлы вроде uv.lock, poetry.lock и conda lock, имя kernel по проекту, связку с Jupytext и очистку вывода через nbstripout или pre-commit hook. Пути и параметры берутся из config-ячейки или Papermill, секреты загружаются через переменные окружения или secrets manager. После преобразований добавляются assert для строк, null-значений и уникальности ключей, а дорогие шаги кэшируются в Parquet. Без запуска «Restart and Run All» скрытое состояние ячеек может сохранить ошибку порядка выполнения.
Какие задачи решает
- проверить, что ноутбук запускается сверху вниз
- вынести импорты и настройки из разбросанных ячеек
- подготовить ноутбук к ревью и коммиту
- заменить жёстко заданные пути параметрами
- зафиксировать результаты преобразований и проверить ключи
Примеры запросов агенту
- Проверь
03-churn-features.ipynb: он должен запускаться сверху вниз после «Restart and Run All». - Разложи импорты, конфигурацию и константы по первым ячейкам, а повторяемую логику вынеси в Python-пакет.
- Подготовь ноутбук к коммиту: очисти вывод через
nbstripout, добавь проверки строк и null-значений, убери секреты из файла.
Как установить Jupyter Notebook taste
Как использовать
Вставьте текст в начало диалога или в инструкции проекта
Вручную: положить файлы
.claude/commands/prompts.csv.mdВопросы о Jupyter Notebook taste
Как установить Jupyter Notebook taste в Claude Code?
Размести файл промпта по пути .claude/commands/prompts.csv.md. Для ChatGPT отдельная команда установки не нужна.
Что делает Jupyter Notebook taste?
Он задаёт правила воспроизводимых Jupyter-ноутбуков: запуск сверху вниз, порядок импортов и настроек, вынос логики в пакет, очистку вывода и проверки данных.
Как обрабатывать ноутбуки, которые запускаются по расписанию?
Такие ноутбуки предлагается превратить в скрипты или задания Papermill и добавить тесты, вместо ручного открытия.
Исходный текст
prompts.csv · CC0-1.0
# Jupyter Notebook taste of a data scientist who wants notebooks that rerun cleanly - Make every notebook run top to bottom with "Restart and Run All" before sharing or committing it. Confidence: 0.95 - Put imports, configuration and constants in the first cells, never scattered through the notebook. Confidence: 0.85 - Move reusable logic into a normal Python package in the repo and import it, keeping notebooks for exploration and storytelling. Confidence: 0.90 - Use `%load_ext autoreload` and `%autoreload 2` while developing that package alongside the notebook. Confidence: 0.75 - Pin the environment with a lock file such as `uv.lock`, `poetry.lock` or a conda lock, and name the kernel after the project. Confidence: 0.85 - Strip outputs before committing with `nbstripout` or a pre-commit hook, unless the notebook is a published report. Confidence: 0.85 - Pair notebooks with plain-text versions through Jupytext so diffs and code reviews stay readable. Confidence: 0.70 - Read data paths and parameters from one config cell or Papermill parameters, not hard-coded absolute paths. Confidence: 0.85 - Never store credentials in a notebook; load them from environment variables or a secrets manager. Confidence: 0.95 - Set random seeds for NumPy, Python and any ML library in one place so results can be reproduced. Confidence: 0.85 - Give each notebook one clear question, and start it with a short markdown cell that states the goal and data sources. Confidence: 0.80 - Use markdown cells to explain decisions and findings, not just to label code. Confidence: 0.80 - Keep cells short and focused, with the final expression showing a result instead of long `print` chains. Confidence: 0.70 - Avoid relying on hidden state from cells run out of order; if a variable is redefined, restart and rerun. Confidence: 0.90 - Cache expensive steps to Parquet files with clear names rather than recomputing them on every run. Confidence: 0.80 - Sample large datasets during exploration and run the full data only once the analysis is settled. Confidence: 0.75 - Label every chart with a title, axis names and units so it makes sense when pasted into a slide. Confidence: 0.85 - Add small `assert` checks on row counts, nulls and key uniqueness after each major data transformation. Confidence: 0.80 - Name notebooks with a number and topic like `03-churn-features.ipynb` so the order of work is obvious. Confidence: 0.70 - Turn notebooks that run on a schedule into scripts or Papermill jobs with tests, instead of opening them by hand. Confidence: 0.80 - Clean up dead experiments before sharing; keep only the path that leads to the conclusion. Confidence: 0.75
© f · CC0-1.0 · f/prompts.chat