Kaggle Notebook Format Rules
Cell Separators
- Code cells:
# %% [code] - Markdown cells:
# %% [markdown]
Markdown Cell Formatting
CRITICAL RULES:
- Every line must start with
#(hash + space) - NEVER use triple quotes (
"""or''') for markdown cells - NO empty lines with only
#- they create extra whitespace in rendered notebook
Correct markdown cell:
# %% [markdown]
# # Title
# Content line 1
# Content line 2
# - Bullet point 1
# - Bullet point 2
Code Cell Conventions
- Printed output in English
- File extension:
.py(not.ipynb) - Dataset paths:
/kaggle/input/dataset-name/
Package Installation
- Only install packages NOT pre-installed on Kaggle
- Use
%pip install -q package-name(not!pip install) - Common libraries (pandas, numpy, scipy, scikit-learn, torch, torchvision) are already available
Common Mistakes to Avoid
- Triple quotes in markdown cells → Use
#prefix on every line - Empty
#lines → Remove them - Missing
#prefix → Every line must start with# - Using
## Title→ Use# Titleonly - Using
!pip→ Use%pip