Notebook Guidance
When to Use a Notebook
Before choosing to use a notebook, evaluate the task complexity using these
heuristics.
Use a notebook if you meet at least one of these criteria:
- 📈 Data Insights & Storytelling: Use a notebook for any request to "give
insights", "find trends", "explore data", or "analyze data". These tasks
benefit from using visualizations to present the data.
- 📊 Visualizations are requested: The user explicitly asks for charts or
plots.
- 🔄 Stateful / Iterative Exploration: You need to run a query, inspect
results, and decide the next query based on those results while keeping
state in memory.
Do NOT use a notebook ONLY if:
- 📝 Simple Fact/Status: The request only requires a single number (e.g.,
"how many rows") or a status check (e.g., "when was this table updated").
- 🏃♂️ Schema Preview: The request is only about the schema or field
types.
Golden Rule of Data Storytelling: If any analytical insight, trend, or
comparison is involved, favor a notebook and a visualization. A notebook is the
"standard" environment for our developer workflow; do not avoid it because of
"overhead".
Notebook Best Practices
[!IMPORTANT]
Agent execution rules: Your behavior MUST depend on whether the
notebook_execute_cell tool is available in your current context: * If
notebook execute_cell tool is available: You MUST follow the incremental
GENERATE CELL -> EXECUTE CELL -> VALIDATE flow. * If notebook execute_cell
tool is NOT available: You MUST generate the complete notebook and request
user execution.
- CONDITIONAL EXECUTION FLOW:
- If notebook
execute_cell tool is available: Follow the STEP BY
STEP GENERATE CELL -> EXECUTE CELL -> VALIDATE OUTPUT flow. Generate
ONE cell, execute it, then verify the output. If the output is data
(e.g. a dataframe), you MUST inspect it to confirm the logic is correct
before generating the next step. Batch generation of an entire notebook
is strictly prohibited because error propagation in notebooks is
expensive to fix.
- If notebook
execute_cell tool is NOT available:
- Create the whole notebook at once.
- Tell the user to run the notebook.
- Tell the user to let you know once the notebook run is completed so
you can check the outputs to verify it's correct and fix any errors.
- IDENTIFY DATA EARLY: Use
@skill:discovering-gcp-data-assets or
BigQuery list tools to find the correct project.dataset.table before
writing ANY code. If the table ID is missing, ask the user.
- CLEAN FINAL STATE: The final notebook MUST NOT have failed cells. If a
cell fails, you MUST fix it. If you tried several versions, delete the
failed attempts before you present the notebook to the user.
- LOGICAL CHUNK FIDELITY: Keep cells small. One logical transformation or
visualization per cell. Group related cells into logical units (e.g., a
BigQuery
%%bqsql magic cell followed immediately by a Python visualization
cell for those results). Use descriptive markdown cells to separate and
document different logical sections.
- GENERATE VISUALIZATIONS: Always accompany data insights with
visualizations; charts are often more effective than raw numbers for
communicating trends and comparisons.
Kernel & Environment Management
Notebooks run in specific Kernels (execution backends). You MUST ensure the
kernel’s Python environment contains the necessary libraries (bigframes,
ipykernel, etc.).
Kernel Types
- Local Python: Standard Python 3 kernel running on the notebook host
(Managed instance, local machine).
- Cloud Spark Remote (Dataproc Serverless): Transient Spark environment
managed by GCP. Use for large-scale data processing.
- Cloud Spark Remote (Dataproc Cluster): Persistent Spark clusters for
shared or custom configurations.
- Colab (Managed): Ephemeral Google-managed runtimes.
No Active Kernel / Setup Check
- Infer or Ask about Kernel Preferences:
- Infer from Context:
- If the task mentions "Spark", "PySpark", or "distributed compute",
or if the active workspace is already a Spark cluster, lean towards
Remote Spark.
- If the task is focused on "BigQuery", "BigFrames", or standard API
calls, lean towards Local Python.
- Ask when Ambiguous: If multiple options fit, ask if they prefer a
Local Python or a Cloud/Remote Kernel (e.g., Colab, Spark).
- For Local Setup: Use
@skill:managing-python-dependencies to verify if
a virtual environment exists. If not, create one. Ensure ipykernel is
installed in that environment. Install any other relevant libraries.
- For Remote Setup: Advise the user to use the UI to select the
appropriate remote kernel.
[!IMPORTANT]
HARD STOP on kernel failure: If a cell execution returns "no active
kernel" or any kernel-not-found error, you MUST stop immediately. Do NOT
scaffold, generate, or insert any further cells. Inform the user which kernel
is needed (e.g., PySpark / Dataproc Serverless) and wait for explicit
confirmation that a kernel is active before proceeding with notebook
execution.
Proper Library Installation
1. Local Kernels
Before installing any python libraries, you MUST use
@skill:managing-python-dependencies to detect how python dependencies are
managed in the project.
2. Remote Kernels (Spark/Colab)
Since these are often ephemeral or managed by GCP:
- Check first (REQUIRED): Before writing any
%pip install cell, run
%pip list or import <package> to confirm the package is not already
present. Managed runtimes (Dataproc Serverless, Colab) pre-install many
common packages. Only install what is confirmed missing.
- Use
%pip install <package> in the first cell if a package is confirmed
missing and it's the only way to modify the runtime.
When in doubt about the kernel type or preferred installation method, ask the
user for clarification.
Data Analysis & Visualization Rules
Guidelines for performing exploratory data analysis, data cleaning, and
visualization in notebooks.
Notebook Layout
The notebook should read like a story. While you have flexibility (e.g.,
multiple visualizations for one data cell, or data cells building on each
other), aim for this general flow:
- Title & Objective (Markdown Cell)
- What is this notebook for? (e.g.,
# Retention Analysis)
- Section Header (Markdown Cell)
- What are we looking at now? (e.g.,
## Exploring User Retention)
- Data Acquisition/Transformation (Python cell, may contain
%%bqsql
magics)
- Query BigQuery or transform data.
- Verification (Optional but Recommended) (Python Cell)
df.head() or assert sanity checks.
- Visualization (The Goal) (Python Cell)
- Plot the insight (e.g.,
df.plot()).
Repeat steps 2-5 for each new sub-topic or insight. You can have multiple Data
cells before a Visualization, or multiple Visualizations from one Data cell. The
key is to keep them grouped logically and separated by Markdown headers.
Final Summary (Markdown Cell)
- At the end of the notebook, add a markdown cell containing a summary
paragraph that summarizes the findings to the user. The summary MUST
follow these guidelines:
- MUST NOT add Python code to the summary.
- The summary MUST NOT start with a code block.
- The summary MUST be strictly grounded in the numerical data verified in
the notebook.
- The summary MUST ONLY contain the following three sections:
Q&A If the data analysis task contains questions (implied or
explicit), you MUST answer them based on the solving process. Skip
this section if there are no questions to answer.
Data Analysis Key Findings Summarize the key analysis findings
in bullet points, it's a plus to quote the numbers in the previous
steps. Only report high-value findings, skip the obvious ones.
Insights or Next Steps Provide 1-2 concise insights or next
steps in bullet points.
Next Steps: After the notebook has been successfully executed and
verified, and the summary is complete, notify the user and propose next step
suggestions.
Plotting Rules
- You MUST use different colors for different features to ensure plots are
readable for humans.
- When creating a plot, you MUST adjust the figure size based on the number of
features. The labels and legends MUST NOT overlap.
- You SHOULD arrange the layout wisely. Using subplots CAN help in placing
different plots effectively.
- You MUST use inline figures to present figures and plots along with code and
text in the notebook.
- For clustering, use PCA to reduce to 2D before scatter plotting.
- Use Line Charts ONLY for continuous data (e.g. time series) where
interpolation between points is meaningful.
Data Cleaning Rules
- You MUST be careful about missing values and duplicated values.
- You MUST NOT drop columns unless absolutely necessary. Dropping columns is
irreversible.
- You SHOULD focus on columns directly related to accomplishing the task; not
every column NEEDS to be cleaned.
Specialized Notebook Guidance
Refer to the following resources for guidance on specific notebook topics:
1. BigQuery in Notebooks
Use BigFrames magics %%bqsql for BigQuery SQL queries. These cells support
native BigQuery SQL execution and data export to BigFrames dataframes.
[!IMPORTANT]
- Unless specified by the user, always use SQL for querying BigQuery.
- DO NOT use the standard BigQuery Python client library
(
google.cloud.bigquery) or pandas.read_gbq.
- Mandatory dataframe export: Always provide a dataframe name e.g.
%%bqsql <df_name>. This makes it easy to use results in follow up Python
cells.
- Verify that
bigframes version number 2.38.0 and above is installed in
the notebook runtime environment. If it is missing, ask the user if they
would like you to upgrade for them.
Example %%bqsql magic usage:
# Initialize BigFrames and load %%bqsql magics
import bigframes
import bigframes.pandas as bpd
%load_ext bigframes
[!CAUTION]
Always use %load_ext bigframes exactly as shown. Do not load submodules —
for example, %load_ext bigframes.magics or %load_ext bigframes.bigquery
are not valid and must not be used.
[!IMPORTANT]
The bigframes library must be installed. Determine if bigframes needs to be
installed by following @skill:managing-python-dependencies.
%%bqsql df_sample
SELECT * FROM `project.dataset.table` LIMIT 10
Anti-patterns (NEVER DO THESE)
[!CAUTION]
- NO Python SDK for Queries: Do not switch to
client.query(sql).to_dataframe() if SQL fails. Fix the SQL syntax
instead.
- NO Mixing Logic: Do not put Python code in the same cell as
%%bqsql
magics.
Working with SQL Results in Python
Magic cells with %%bqsql <df_name> produce a BigQuery DataFrame. In
subsequent cells, you can use <df_name> directly.
[!IMPORTANT]
You MUST use BigFrames for data exploration, manipulation, splitting etc. You
MUST use BQML SQL or bigframes.ml for machine learning tasks. You MUST NOT use
pandas or Scikit-learn.
BigQuery DataFrame Tips
- Avoid
.to_pandas(): You MUST NOT use .to_pandas() to download the
entire dataset into memory. There are some exceptions:
- An error message explicitly requests you to use
to_pandas()
- You are going to visualize the data, and the visualization library
does not accept BigFrames Dataframe/Series instances. In this case,
reduce the amount of data you are going to download before calling
.to_pandas()
- Avoid
read_gbq() for SQL: Do not write SQL queries and execute them
with read_gbq(). Use BigFrames Dataframe/Series methods instead.
- Use BigFrames ML package for Machine Learning Tasks: Do not use
Scikit-learn or other ML libraries with BigFrames dataframes. Import your
tools/classes from
bigframes.ml.
- Stay in the Cloud: Perform data cleaning, transformation, and analysis
via BigFrames methods to leverage BigQuery's scale.
- Accessors over UDFs/Lambdas:
- Prefer built-in accessors (e.g.,
df.col.str.*, df.col.dt.*) over
remote UDFs.
- Do not use lambdas with
Series.map() or DataFrame.apply().
- Schema Verification: Do not assume schema of intermediate outputs. Check
.dtypes after loading, and use display() with .head() or .peek().
- Visualization: BigFrames Dataframe mostly works directly with
Matplotlib, Seaborn, and other plotting libraries. If your attempt didn't
work, try using the "plot" accessor. If that didn't work either, you MUST
sample or aggregate your data to make it small enough before calling
"to_pandas()".
- Model Persistence: To persist a model. use
model.to_gbq(). To load a
persisted model, use bpd.read_gbq_model().
2. Machine Learning in Notebooks
Integration with machine learning workflows and best practices. - Guide: Use
@skill:ml-best-practices. - MUST READ WHEN: The task involves machine
learning, training a model, clustering, classification, regression, or
time-series forecasting.
If any "MUST READ WHEN" condition is met, you MUST read the corresponding guide
before proceeding.
1---2name: notebook-guidance3description: |-4 This skill guides the use of Jupyter notebooks for data analysis, exploration, and visualization, particularly with BigQuery. It outlines best practices for notebook execution and validation (supporting both cell-by-cell execution and full notebook generation depending on tool availability), library installation, and structuring notebooks for clarity. It also covers specific rules for data cleaning, plotting, and integrating with BigQuery SQL and machine learning workflows.5 Relevant when any of the following conditions are true:6 1. The user request involves a data analysis, data exploration, data visualization, or data insights task that requires multiple steps, queries, or visualizations to answer.7 2. The user explicitly requests a notebook (.ipynb).8 3. You are creating, editing, or executing cells in a Jupyter notebook.9 4. You need to query BigQuery from within a notebook. DO NOT use the Python BigQuery client library; instead, you MUST use the `%%bqsql` magics explained in this skill.10license: Apache-2.011metadata:12 version: v513 publisher: google14---1516# Notebook Guidance1718## When to Use a Notebook1920Before choosing to use a notebook, evaluate the task complexity using these21heuristics.2223Use a notebook if you meet at least one of these criteria:2425* 📈 **Data Insights & Storytelling**: Use a notebook for any request to "give26 insights", "find trends", "explore data", or "analyze data". These tasks27 benefit from using visualizations to present the data.28* 📊 **Visualizations are requested**: The user explicitly asks for charts or29 plots.30* 🔄 **Stateful / Iterative Exploration**: You need to run a query, inspect31 results, and decide the next query based on those results while keeping32 state in memory.3334Do NOT use a notebook ONLY if:3536* 📝 **Simple Fact/Status**: The request only requires a single number (e.g.,37 "how many rows") or a status check (e.g., "when was this table updated").38* 🏃♂️ **Schema Preview**: The request is only about the schema or field39 types.4041**Golden Rule of Data Storytelling:** If any analytical insight, trend, or42comparison is involved, favor a notebook and a visualization. A notebook is the43"standard" environment for our developer workflow; do not avoid it because of44"overhead".4546## Notebook Best Practices4748> [!IMPORTANT]49>50> **Agent execution rules**: Your behavior MUST depend on whether the51> `notebook_execute_cell` tool is available in your current context: * **If52> notebook `execute_cell` tool is available**: You MUST follow the incremental53> GENERATE CELL -> EXECUTE CELL -> VALIDATE flow. * **If notebook `execute_cell`54> tool is NOT available**: You MUST generate the complete notebook and request55> user execution.56571. **CONDITIONAL EXECUTION FLOW**:58 * **If notebook `execute_cell` tool is available**: Follow the **STEP BY59 STEP GENERATE CELL -> EXECUTE CELL -> VALIDATE OUTPUT** flow. Generate60 ONE cell, execute it, then verify the output. If the output is data61 (e.g. a dataframe), you MUST inspect it to confirm the logic is correct62 before generating the next step. Batch generation of an entire notebook63 is strictly prohibited because error propagation in notebooks is64 expensive to fix.65 * **If notebook `execute_cell` tool is NOT available**:66 * Create the whole notebook at once.67 * Tell the user to run the notebook.68 * Tell the user to let you know once the notebook run is completed so69 you can check the outputs to verify it's correct and fix any errors.702. **IDENTIFY DATA EARLY**: Use `@skill:discovering-gcp-data-assets` or71 BigQuery list tools to find the correct `project.dataset.table` before72 writing ANY code. If the table ID is missing, ask the user.733. **CLEAN FINAL STATE**: The final notebook MUST NOT have failed cells. If a74 cell fails, you MUST fix it. If you tried several versions, delete the75 failed attempts before you present the notebook to the user.764. **LOGICAL CHUNK FIDELITY**: Keep cells small. One logical transformation or77 visualization per cell. Group related cells into logical units (e.g., a78 BigQuery `%%bqsql` magic cell followed immediately by a Python visualization79 cell for those results). Use descriptive **markdown cells** to separate and80 document different logical sections.815. **GENERATE VISUALIZATIONS**: Always accompany data insights with82 visualizations; charts are often more effective than raw numbers for83 communicating trends and comparisons.8485## Kernel & Environment Management8687Notebooks run in specific **Kernels** (execution backends). You MUST ensure the88kernel’s Python environment contains the necessary libraries (`bigframes`,89`ipykernel`, etc.).9091### Kernel Types92931. **Local Python**: Standard Python 3 kernel running on the notebook host94 (Managed instance, local machine).952. **Cloud Spark Remote (Dataproc Serverless)**: Transient Spark environment96 managed by GCP. Use for large-scale data processing.973. **Cloud Spark Remote (Dataproc Cluster)**: Persistent Spark clusters for98 shared or custom configurations.994. **Colab (Managed)**: Ephemeral Google-managed runtimes.100101### No Active Kernel / Setup Check1021031. **Infer or Ask about Kernel Preferences**:104 - **Infer from Context**:105 - If the task mentions "Spark", "PySpark", or "distributed compute",106 or if the active workspace is already a Spark cluster, lean towards107 **Remote Spark**.108 - If the task is focused on "BigQuery", "BigFrames", or standard API109 calls, lean towards **Local Python**.110 - **Ask when Ambiguous**: If multiple options fit, ask if they prefer a111 **Local Python** or a **Cloud/Remote Kernel** (e.g., Colab, Spark).1122. **For Local Setup**: Use `@skill:managing-python-dependencies` to verify if113 a virtual environment exists. If not, create one. Ensure `ipykernel` is114 installed in that environment. Install any other relevant libraries.1153. **For Remote Setup**: Advise the user to use the UI to select the116 appropriate remote kernel.117118> [!IMPORTANT]119>120> **HARD STOP on kernel failure**: If a cell execution returns "no active121> kernel" or any kernel-not-found error, you MUST **stop immediately**. Do NOT122> scaffold, generate, or insert any further cells. Inform the user which kernel123> is needed (e.g., PySpark / Dataproc Serverless) and wait for explicit124> confirmation that a kernel is active before proceeding with notebook125> execution.126127### Proper Library Installation128129#### 1. Local Kernels130131Before installing any python libraries, you MUST use132`@skill:managing-python-dependencies` to detect how python dependencies are133managed in the project.134135#### 2. Remote Kernels (Spark/Colab)136137Since these are often ephemeral or managed by GCP:138139* **Check first (REQUIRED)**: Before writing any `%pip install` cell, run140 `%pip list` or `import <package>` to confirm the package is not already141 present. Managed runtimes (Dataproc Serverless, Colab) pre-install many142 common packages. Only install what is confirmed missing.143* Use `%pip install <package>` in the first cell if a package is confirmed144 missing and it's the only way to modify the runtime.145146When in doubt about the kernel type or preferred installation method, ask the147user for clarification.148149## Data Analysis & Visualization Rules150151Guidelines for performing exploratory data analysis, data cleaning, and152visualization in notebooks.153154### Notebook Layout155156The notebook should read like a story. While you have flexibility (e.g.,157multiple visualizations for one data cell, or data cells building on each158other), aim for this general flow:1591601. **Title & Objective** (Markdown Cell)161 * What is this notebook for? (e.g., `# Retention Analysis`)1622. **Section Header** (Markdown Cell)163 * What are we looking at now? (e.g., `## Exploring User Retention`)1643. **Data Acquisition/Transformation** (Python cell, may contain `%%bqsql`165 magics)166 * Query BigQuery or transform data.1674. **Verification (Optional but Recommended)** (Python Cell)168 * `df.head()` or assert sanity checks.1695. **Visualization (The Goal)** (Python Cell)170 * Plot the insight (e.g., `df.plot()`).171172*Repeat steps 2-5 for each new sub-topic or insight. You can have multiple Data173cells before a Visualization, or multiple Visualizations from one Data cell. The174key is to keep them grouped logically and separated by Markdown headers.*1751761. **Final Summary** (Markdown Cell)177178 * At the end of the notebook, add a markdown cell containing a summary179 paragraph that summarizes the findings to the user. The summary MUST180 follow these guidelines:181 * MUST NOT add Python code to the summary.182 * The summary MUST NOT start with a code block.183 * The summary MUST be strictly grounded in the numerical data verified in184 the notebook.185 * The summary MUST ONLY contain the following three sections:186 * ### Q&A If the data analysis task contains questions (implied or187 explicit), you MUST answer them based on the solving process. Skip188 this section if there are no questions to answer.189 * ### Data Analysis Key Findings Summarize the key analysis findings190 in bullet points, it's a plus to quote the numbers in the previous191 steps. Only report high-value findings, skip the obvious ones.192 * ### Insights or Next Steps Provide 1-2 concise insights or next193 steps in bullet points.1941952. **Next Steps**: After the notebook has been successfully executed and196 verified, and the summary is complete, notify the user and propose next step197 suggestions.198199### Plotting Rules2002011. You MUST use different colors for different features to ensure plots are202 readable for humans.2032. When creating a plot, you MUST adjust the figure size based on the number of204 features. The labels and legends MUST NOT overlap.2053. You SHOULD arrange the layout wisely. Using subplots CAN help in placing206 different plots effectively.2074. You MUST use inline figures to present figures and plots along with code and208 text in the notebook.2095. For clustering, use PCA to reduce to 2D before scatter plotting.2106. Use **Line Charts** ONLY for continuous data (e.g. time series) where211 interpolation between points is meaningful.212213### Data Cleaning Rules2142151. You MUST be careful about missing values and duplicated values.2162. You MUST NOT drop columns unless absolutely necessary. Dropping columns is217 irreversible.2183. You SHOULD focus on columns directly related to accomplishing the task; not219 every column NEEDS to be cleaned.220221## Specialized Notebook Guidance222223Refer to the following resources for guidance on specific notebook topics:224225### 1. BigQuery in Notebooks226227Use BigFrames magics `%%bqsql` for BigQuery SQL queries. These cells support228native BigQuery SQL execution and data export to BigFrames dataframes.229230> [!IMPORTANT]231>232> * Unless specified by the user, **always use SQL for querying BigQuery.**233> * DO NOT use the standard BigQuery Python client library234> (`google.cloud.bigquery`) or `pandas.read_gbq`.235> * **Mandatory dataframe export**: Always provide a dataframe name e.g.236> `%%bqsql <df_name>`. This makes it easy to use results in follow up Python237> cells.238> * Verify that `bigframes` version number `2.38.0` and above is installed in239> the notebook runtime environment. If it is missing, ask the user if they240> would like you to upgrade for them.241242**Example %%bqsql magic usage:**243244```python245# Initialize BigFrames and load %%bqsql magics246import bigframes247import bigframes.pandas as bpd248%load_ext bigframes249```250251> [!CAUTION]252>253> Always use `%load_ext bigframes` exactly as shown. Do not load submodules —254> for example, `%load_ext bigframes.magics` or `%load_ext bigframes.bigquery`255> are not valid and must not be used.256257> [!IMPORTANT]258>259> The `bigframes` library must be installed. Determine if bigframes needs to be260> installed by following @skill:managing-python-dependencies.261262```python263%%bqsql df_sample264SELECT * FROM `project.dataset.table` LIMIT 10265```266267#### Anti-patterns (NEVER DO THESE)268269> [!CAUTION]270>271> 1. **NO Python SDK for Queries**: Do not switch to272> `client.query(sql).to_dataframe()` if SQL fails. Fix the SQL syntax273> instead.274> 2. **NO Mixing Logic**: Do not put Python code in the same cell as `%%bqsql`275> magics.276277#### Working with SQL Results in Python278279Magic cells with `%%bqsql <df_name>` produce a **BigQuery DataFrame**. In280subsequent cells, you can use `<df_name>` directly.281282> [!IMPORTANT]283>284> You MUST use BigFrames for data exploration, manipulation, splitting etc. You285> MUST use BQML SQL or bigframes.ml for machine learning tasks. You MUST NOT use286> pandas or Scikit-learn.287288##### BigQuery DataFrame Tips289290* **Avoid `.to_pandas()`**: You MUST NOT use `.to_pandas()` to download the291 entire dataset into memory. There are some exceptions:292 * An error message explicitly requests you to use `to_pandas()`293 * You are going to visualize the data, **and** the visualization library294 does not accept BigFrames Dataframe/Series instances. In this case,295 reduce the amount of data you are going to download before calling296 `.to_pandas()`297* **Avoid `read_gbq()` for SQL**: Do not write SQL queries and execute them298 with `read_gbq()`. Use BigFrames Dataframe/Series methods instead.299* **Use BigFrames ML package for Machine Learning Tasks**: Do not use300 Scikit-learn or other ML libraries with BigFrames dataframes. Import your301 tools/classes from `bigframes.ml`.302* **Stay in the Cloud**: Perform data cleaning, transformation, and analysis303 via BigFrames methods to leverage BigQuery's scale.304* **Accessors over UDFs/Lambdas**:305 * Prefer built-in accessors (e.g., `df.col.str.*`, `df.col.dt.*`) over306 remote UDFs.307 * **Do not use lambdas** with `Series.map()` or `DataFrame.apply()`.308* **Schema Verification**: Do not assume schema of intermediate outputs. Check309 `.dtypes` after loading, and use `display()` with `.head()` or `.peek()`.310* **Visualization**: BigFrames Dataframe mostly works directly with311 Matplotlib, Seaborn, and other plotting libraries. If your attempt didn't312 work, try using the "plot" accessor. If that didn't work either, you MUST313 sample or aggregate your data to make it small enough before calling314 "to_pandas()".315* **Model Persistence**: To persist a model. use `model.to_gbq()`. To load a316 persisted model, use `bpd.read_gbq_model()`.317318### 2. Machine Learning in Notebooks319320Integration with machine learning workflows and best practices. - **Guide**: Use321`@skill:ml-best-practices`. - **MUST READ WHEN**: The task involves machine322learning, training a model, clustering, classification, regression, or323time-series forecasting.324325If any "MUST READ WHEN" condition is met, you MUST read the corresponding guide326before proceeding.