AI Platform Notebooks is a managed service that offers an integrated and secure JupyterLab environment for data scientists and machine learning developers to experiment, develop, and deploy models into production.
This directory contains AI Platform Notebooks code samples and tutorials. The tutorials are divided into 2 sections:
- AI Platform Notebooks API code samples
- AI Platform Notebooks tutorials
In this folder you will find Python code samples to interact with the AI Platform Notebooks API
Run in AI Platform Notebooks
- Create a Notebook instance
- Clone this repository via Jupyter console or using the Git clone button
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
- Open the tutorials folder and open the Jupyter notebooks
Run locally
- Install Jupyter notebooks (instructions)
- Install the dependencies in the requirements.txt file (instructions below)
- Registered the
google-cloud-bigquery
magic commands (instructions below) - Set
matplotlib
to render inline (instructions below)
Install the dependencies with the following command:
pip install --upgrade -r requirements.txt
You can either perform these set up steps in a single notebook, or add the steps to your IPython configuration file to apply to all notebooks.
To perform the set up steps for a single notebook, run the following commands
in your notebook to register the BigQuery magic commands and set matplotlib
to render inline:
%load_ext google.cloud.bigquery
%matplotlib inline
To perform the set up steps implicitly for all of your notebooks, add the
following code to your ipython_config.py
file to register the BigQuery magic
commands and set matplotlib
to render inline:
c = get_config()
# Register magic commands
c.InteractiveShellApp.extensions = [
'google.cloud.bigquery',
]
# Enable matplotlib renderings to render inline in the notebook.
c.InteractiveShellApp.matplotlib = 'inline'
See IPython documentation for more information about IPython configuration.