The code prints out the population and area of the five selected states. In the next cell, enter the following code and press Control+Enter, this will run the cell without creating a new cell below. While iterating, it also combines the geometries of the individual states into a single arcpy.Polygon object stored in the geom variable.ĩ. It totals the population and stores the result in the pop variable. The code iterates through the selected population and geometry records of the USA_States_Generalized dataset. With arcpy.da.SearchCursor(lyr, ["POP2010", as rows: # Summarize New England state population and area In the next cell, enter the following code and press Shift+Enter: We would like to report the total population and area of these five states. We can see the relative size of the populations of these individual states compared to other states. Arrange the map and notebook views so they are both visible side-by-side.ħ. Geoprocessing operations performed in the notebook will honor selections made in Pro. Complete steps 8-9 with the five states (Maine, Massachusetts, New Hampshire, Rhode Island, and Vermont) selected.įrom the Map ribbon click the Select button and select the states Maine, Massachusetts, New Hampshire, Rhode Island, and Vermont. The above code adds a chart to the map layer and prints the result in the notebook cell output area.Ħ.
Us_states = aprx.listMaps().listLayers(lyr)Ĭhart.title = "Comparison of populations by State"Īs of ArcGIS Pro 2.6, charts can be displayed in notebooks. To add a chart to a layer or notebook, first create a Chart object, then configure its properties, and finally associate the Chart with an arcpy.mp.Layer from an arcpy.mp.ArcGISProject. Let’s visualize the population of US states with a chart to get an understanding of our data. Shift+Enter is a useful keyboard shortcut for Run Cells And Select Below.ĥ. Next, enter the following code into the newly created cell and then press Shift+Enter to run the current cell and simultaneously create a new cell below. Markdown allows you to narrate a notebook and break it into sections.Ĥ. The text becomes a header and description for your notebook. This runs the cell and simultaneously creates a new cell below (or selects it if a cell already exists below the cell being executed). What are the 2010 population and area of New England?ģ. Select Markdown from the drop-down list above the cell, and from the Cell menu of the notebook view select Run Cells And Select Below.
In the Notebook view (see Get Started to learn how to create a new notebook view), enter the following text into the first cell. Right-click the item named USA States (Generalized) and select Add To Current Map.Ģ. Navigate to the Portal tab on the Catalog pane, click the Living Atlas tab and type USA States into the search box and hit the enter key.
Note: Before getting started, make sure you are signed into ArcGIS Online or your organization's Portal.ġ. This tutorial explores the 2010 census population data for New England states, and provides an example of how ArcGIS Notebooks and ArcGIS Pro can interact. Note: You can arrange the notebook view so that you can see your map and notebook side-by-side.
Creating a new notebook will immediately open it, allowing you to jump right into entering code To get started with notebooks in Pro, open a new project and from the Insert ribbon click New Notebook.
Five Tips To Get You Started With Jupyter Notebooks Blog.To learn more about notebooks in Pro, see the following:
With ArcGIS Pro 2.7, there are several updates that improve your experience, including the following: See the ArcGIS Notebooks landing page to learn more about notebooks across Esri products. They have become widely adopted by the data science community because they support iteratively and interactively documenting, processing, analyzing, and visualizing data in a notebook format that can be saved, shared, and used to report results. Jupyter notebooks combine cells of live Python code with narrative text and visualizations in a single document. Since Pro 2.5, notebooks can run directly in ArcGIS Pro allowing a side-by-side view of your map and notebook and for direct interactions with the data on your map. ArcGIS Notebooks are based on the open-source Jupyter notebook, which has been included in the ArcGIS Pro Python distribution since ArcGIS Pro 2.1.