ArcGIS Notebooks are built on top of the Jupyter Notebook, an open-source web application that allows you to create and share documents that contain live Python code, visualizations, and narrative text. With ArcGIS Notebooks integrated into ArcGIS Pro, you can perform analysis and immediately view results in a geographic context, interact with the emerging data, document and automate your workflow, and save it for later use or share it. ArcGIS Notebooks uses include data cleaning and transformation, numerical simulation, statistical modeling, machine learning, administrative tasks, and more.
All Python functionality in ArcGIS Pro is available through ArcGIS Notebooks, including core Python functionality, the Python standard library, ArcPy, ArcGIS API for Python, and the numerous third-party libraries included with ArcGIS Pro such as NumPy and pandas. ArcGIS Pro can be extended with open-source libraries using the ArcGIS Pro Python Package Manager.
While open-source Jupyter Notebooks are run locally in the ArcGIS Pro application, Esri's integrated Jupyter Notebook experience is also available in an ArcGIS Enterprise portal with ArcGIS Notebook Server.
Learn more about ArcGIS Notebooks
If you are looking for an interactive Python terminal to test or run short snippets of code without advanced notebook capabilities, see Python window.
How to use ArcGIS Notebooks in ArcGIS Pro
To create a notebook, click the Insert tab on the ribbon, and click the New Notebook button . Alternatively, open the Catalog pane, browse to your project directory, right-click a folder, and select New > Notebook .
ArcGIS Notebooks that have been added to a project are listed under the Notebooks folder in the Catalog pane. Notebooks that are created using ArcGIS Pro are automatically added to your project. To add an existing notebook to the project, right-click the Notebooks folder and choose Add Notebook , or alternatively click the drop-down arrow next to the Add Notebook button on the Insert ribbon and select Add Notebook.
To open an existing notebook in your project, browse to the notebook file in the Catalog pane and either double-click the notebook, or right-click the notebook and select Open Notebook.
The notebook opens in a user interface similar to the standard Jupyter Notebook, with the New button , the Save button , and the Interrupt Kernel button located on the ArcGIS Pro Notebook tab. The Notebook ribbon appears automatically when the Notebook view is open. See the Jupyter Notebook user interface documentation for details on how to interact with Jupyter Notebooks.
To export a Notebook, use the Export drop-down menu to export a notebook to a Python (.py) or HTML (.html) file.
Additional help
The Notebook view help menu provides a tour of the Jupyter Notebook user interface, keyboard shortcuts, Markdown, and other relevant topics.
The tab completion feature provides contextual help based on the location of the pointer. Methods and properties can be viewed by pressing Tab after the dot following the object or library name. For example, type arcpy.analysis into a cell and press Tab to display a list of possible methods available from the analysis module. Once the list is displayed, you can filter it further by typing related words. After selecting a suitable method from the list, press Enter to use it.
Python tools, modules, functions, classes, and keywords all store documentation that provides information on their use. Activate the documentation at the pointer by pressing Shift+Tab. The following is the documentation displayed for the Buffer tool:
Alternatively, the same documentation can be accessed using the built-in Python help function. The following is the help documentation displayed for arcpy.analysis.Buffer:
Integration with ArcGIS Pro
In addition to the Python window, ArcGIS Notebooks in ArcGIS Pro provide access to content in your map, allowing for interactive workflows such as the following:
- Layers and other contents of your map can be accessed in your notebook by name or using a path to the data.
- The output of geoprocessing tools is added to the active map by default.
- Geoprocessing tools honor selections.
- Global geoprocessing environment settings are respected and can be overridden by environment settings.
- Geoprocessing workflows can occur during an ongoing editing session. If a geoprocessing tool directly modifies a feature being edited in an edit session (it does not save the result of geoprocessing as another feature class), you can save or discard the modifications from the Edit ribbon.
- When a geoprocessing tool is run from an ArcGIS Notebook, the tool's result log appears in the geoprocessing history.
Caution:
ArcGIS Pro is designed to run a single Python instance. This Python instance is shared by each open notebook in a single instance of ArcGIS Pro. If different notebooks use the same variable name, variable name collisions could result. To avoid potential variable name collisions, consider the following options:
- Open one notebook at a time.
- Run notebooks in separate instances of ArcGIS Pro.
- Use unique variable names in concurrently running notebooks.
- Run the %reset -f magic command to delete all variables in a notebook.
Caution:
ArcGIS Notebooks hosted with ArcGIS Enterprise are not supported directly in ArcGIS Pro. To use a hosted notebook in ArcGIS Pro, download and use the .ipynb file locally.
Note:
When using the %matplotlib inline magic command to display plots, it is necessary to draw the plot using the show() function of matplotlib.pyplot.ArcGIS Notebooks in ArcGIS Pro only support Python; no other language kernels (such as R) are supported.
ArcGIS API for Python
In the ArcGIS API for Python, the GIS object is used to represent the GIS you are working with, such as ArcGIS Online or an instance of ArcGIS Enterprise. Your GIS can support a number of authentication schemes; see Working with different authentication schemes to learn how to authenticate your scripts and notebooks for different schemes.
For example, to connect to ArcGIS Online as an anonymous user, specify gis = GIS(). To connect to your active portal in ArcGIS Pro without entering credentials, specify gis = GIS("pro").