About Snowflake Notebooks

Snowflake Notebooks is a development interface in Snowsight that offers an interactive, cell-based programming environment for Python and SQL. In Snowflake Notebooks, you can perform exploratory data analysis, develop machine learning models, and perform other data science and data engineering tasks all in one place.

  • Explore and experiment with data already in Snowflake, or upload new data to Snowflake from local files, external cloud storage, or datasets from the Snowflake Marketplace.

  • Write SQL or Python code and quickly compare results with cell-by-cell development and execution.

  • Interactively visualize your data using embedded Streamlit visualizations and other libraries like Altair, Matplotlib, or seaborn.

  • Contextualize results and make notes about different results with Markdown cells.

  • Keep your data fresh by relying on the default behavior to run a cell and all modified cells preceding it or debug your notebook by running it cell-by-cell.

  • Run your notebook on a schedule. See Schedule your Snowflake Notebook to run.

  • Make use of the role-based access control and other data governance functionality available in Snowflake to allow other users with the same role to view and collaborate on the notebook.

An example notebook in the Snowsight UI

Notebook runtimes

Snowflake Notebooks offers two types of runtimes, warehouse runtime and container runtime. Notebooks rely on virtual warehouses and/or Snowpark Container Services compute pools to provide the compute resource. For both architectures, SQL and Snowpark queries are always pushed down to execute on the warehouse for optimized performance.

The warehouse runtime gives you the fastest way to get started, with a familiar warehouse environment that is generally available. The container runtime provides a more flexible environment that can support many different types of workloads, including SQL analytics and data engineering. You can install additional Python packages if the container runtime doesn’t include what you need by default. Container runtime also come in CPU and GPU versions that have many popular ML packages pre-installed, making them ideal for ML and deep learning workloads.

The following table shows supported features for each type of runtime. You can use this table to help decide which runtime is the right choice for your use case.

Supported features

Warehouse Runtime

Container Runtime

Compute

Kernel runs on Snowflake-managed default warehouse.

Kernel runs on Compute Pool node;

Environment

Python 3.9

Python 3.10

Base image

Streamlit + Snowpark

Snowflake container runtime. CPU and GPU images are pre-installed with a set of Python libraries.

Additional Python libraries

Install using Snowflake Anaconda or from a Snowflake stage.

Install using pip or from a Snowflake stage.

Editing support

  • Python, SQL and Markdown cells.

  • Reference outputs from SQL cells in Python cells and vice versa.

  • Use visualization libraries like Streamlit.

Same as warehouse

Access

Ownership required to access and edit notebooks.

Same as warehouse

Supported Notebook features

  • Git integration

  • Multi-file editing

  • Scheduling

Same as warehouse

Get started with Snowflake Notebooks

To start experimenting with Snowflake Notebooks, sign into Snowsight, set up your account to use notebooks, and then select Notebooks from the Projects pane. A list of notebooks that you have access to in your account is displayed. You can either create a new notebook from scratch or upload an existing .ipynb file.

The following table shows the topics to review if you’re new to Snowflake Notebooks:

Getting started guides

Set up Snowflake Notebook

Setting up Snowflake Notebooks

Instructions for developers and admins before using Notebook.

Create Snowflake Notebook

Create a Snowflake Notebook

Create a new notebook from scratch or from an existing file.

Develop and run code in Snowflake Notebook

Develop and Run Code in Snowflake Notebook

Create, edit, execute Python, SQL, Markdown cells.

Developer guides

Guide

Description

Session context in notebooks

Accessing and modifying the session context.

Saving results in notebooks

Saving notebooks and results across session.

Import Python packages to use in notebooks

Importing Python package from Anaconda channel.

Visualize and Interact with your data in Notebook

Visualize data with matplotlib, plotly, altair and develop a data app with Streamlit.

Cell and variable referencing in Notebook

Reference SQL cell output and Python variable values.

Keyboard shortcuts for Notebooks

Leverage keyboard shortcut to navigate and streamline editing experience.

Leveling up your notebook workflows

Guide

Description

Sync Snowflake Notebooks with Git

Version control your notebook for collaboration and development.

Work with files in notebook

Manage and work with files in your notebook environment.

Schedule notebook runs

Schedule notebooks to run and execute code within Snowflake.

Experience Snowflake with notebooks

Leverage other Snowflake capabilities within Snowflake Notebooks.

Troubleshoot errors in Snowflake Notebooks

Troubleshoot errors you may run into while using Snowflake Notebooks.

Quickstarts

Highlighted use cases

Check out highlighted use cases for data science, data engineering and ML/AI in Github.

Data engineering on Snowflake Notebook

Data Engineering

Develop, manage, schedule and run scalable data pipelines with SQL and Snowpark.

Data science using Snowflake Notebook

Data Science

Explore, visualize, and analyze your data with Python and SQL.

Machine learning using Snowflake Notebook

Machine Learning and AI

Feature Engineering, model training, and development with Cortex and Snowpark ML.

Note

These are only shown as examples, and following along with the example may require additional rights to third-party data, products, or services that are not owned or provided by Snowflake. Snowflake does not guarantee the accuracy of these examples.

Additional resources

  • For notebook demos, tutorials and examples, see collection of Snowflake Notebooks demos in Github.

  • To view tutorial videos, see the Snowflake Notebooks Youtube playlist.

  • To learn about SQL commands to create, execute and show notebooks, see Snowflake Notebooks API reference.

  • Looking for reference architectures, industry specific use-cases and solutions best practices using Notebooks? See Notebooks examples in the Snowflake Solution Center.