After you attach a notebook to a cluster and run one or more cells, your notebook has state and displays outputs. This section describes how to manage notebook state and outputs.
Clear notebooks state and outputsâTo clear the notebook state and outputs, select one of the Clear options at the bottom of the Run menu.
Results tableâWhen a cell is run, results are shown in a results table. With the results table, you can do the following:
To view limits on the results table, see Notebook results table limits.
Select dataâTo select data in the results table, do any of the following.
To open a side panel displaying selection information, click the panel icon icon in the upper-right corner, next to the Search box.
Copy data to clipboardâTo copy the results table in CSV format to the clipboard, click the downward arrow next to the table title tab, then click Copy results to clipboard.
Alternatively, click the box in the table's top left to select the full table, and then right-click and select Copy from the drop-down menu.
There are several ways to copy selected data:
Cmd + C
on MacOS or Ctrl + C
on Windows to copy the results to the clipboard in CSV format.To sort the results table by the values in a column, hover your cursor over the column name. An icon containing the column name appears at the right of the cell. Click the arrow to sort the column.
To sort by multiple columns, hold down the Shift key as you click the sort arrow for the columns.
Sorting follows natural sort order by default. To enforce a lexicographical sort order, use ORDER BY
in SQL or the respective SORT
functions available in your environment.
Use filters on a results table to take a closer look at the data. Filters applied to result tables also affect visualizations, enabling interactive exploration without modifying the underlying query or dataset. See Filter a visualization.
There are several ways to create a filter:
Use natural language prompts with Assistant
If you have Databricks Assistant enabled, you can create filters using natural language prompts.
If you want to create additional filters with Assistant, click next to the filter(s) to enter another prompt.
See Filter data with natural language prompts.
Use the built-in filter dialog
Filter by a specific value
Filter on a specific column
To temporarily enable or disable a filter, toggle the Enabled/Disabled button in the dialog.
To delete a filter, click next to the filter name .
Apply filters to full datasetâBy default, filters are applied only to the results shown in the results table. If the data returned is truncated (for example, when a query returns more than 10,000 rows or the dataset is larger than 2MB), the filter is applied only to the returned rows. A note in the top right of the table indicates that the filter was applied to truncated data.
You can choose to filter the full dataset instead. Click Truncated data, then choose Full dataset. Depending on the size of the dataset, it may take a long time for the filter to apply.
Create a query from filtered resultsâFrom a filtered results table or visualization in a notebook with SQL as the default language, you can create a new query with the filters applied. In the top right of the table or visualization, click Create query. The query is added as the next cell in the notebook.
The created query applies your filters on top of the original query. This allows you to work with a smaller, more relevant dataset, enabling more efficient data exploration and analysis.
Explore columnsâTo facilitate working with tables that have many columns, you can use the column explorer. To open the column explorer, click the column icon () in the top right of a results table.
The column explorer allows you to:
Column headers indicate the data type of the column. For example, indicates integer data type. Hover over the indicator to see the data type.
You can format columns in results tables as types like Currency, Percentage, URL and more, with control over decimal places for clearer tables.
Format columns from the kebab menu in the column name.
Download resultsâBy default, downloading results is enabled. To toggle this setting, see Manage the ability to download results from notebooks.
You can download a cell result that contains tabular output to your local machine. Click the downward pointing arrow next to the tab title. The menu options depend on the number of rows in the result and the Databricks Runtime version. Downloaded results are saved on your local machine as a CSV file with a name corresponding to your notebook name.
For notebooks connected to SQL warehouses or serverless compute, you can also download the results as an Excel file.
Explore SQL cell resultsâIn a Databricks notebook, results from a SQL language cell are automatically available as a DataFrame assigned to the variable _sqldf
. You can use the _sqldf
variable to refer to the previous SQL output in subsequent Python and SQL cells. For details, see Explore SQL cell results.
Python notebooks and %python
cells in non-Python notebooks support multiple outputs per cell. For example, the output of the following code includes both the plot and the table:
Python
import pandas as pd
from sklearn.datasets import load_iris
data = load_iris()
iris = pd.DataFrame(data=data.data, columns=data.feature_names)
ax = iris.plot()
print("plot")
display(ax)
print("data")
display(iris)
Resize outputsâ
Resize cell outputs by dragging the bottom right corner of the table or visualization.
Commit notebook outputs in Databricks Git foldersâTo learn about committing .ipynb notebook outputs, see Allow committing .ipynb notebook output.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4