Note:
The Insights scripting environment is available in Insights in ArcGIS Enterprise and Insights desktop. The primary connection can be to either Insights in ArcGIS Enterprise or Insights in ArcGIS Online.
Jupyter Kernel Gateway connections can be disabled for an Insights in ArcGIS Enterprise organization during the installation process. Contact your administrator if the Jupyter Kernel Gateway connections are not available. For more information, see Install Insights in ArcGIS Enterprise.
Scripting is an important method of extending and customizing existing software to fit the needs of your organization. In ArcGIS Insights, scripting can be done using Python or R as the programming language. Both programming languages will enable users to expand the available spatial and statistical analysis capabilities within an Insights workbook.
Scripting in Insights is enabled using a connection to a Jupyter Kernel Gateway. The kernel gateway provides access to the required kernels, or programming languages, that execute the code written in the scripting environment. The gateway allows access to both Python and R kernels.
The following general steps must be followed to enable scripting in Insights:
- Set up a Jupyter Kernel Gateway that contains a Python kernel, an R kernel, or both.
- Create a connection to the Jupyter Kernel Gateway in Insights.
- Open the scripting environment.
- Create and execute scripts in Python or R.
Capabilities of Python scripting
Python scripting can be used to do the following:
- Manipulate and prepare data.
- Create custom charts and graphs.
- Integrate machine learning analysis into Insights.
- Automate data updates and analysis.
- Convert a dataset to a Pandas, GeoPandas, Koalas, or Spark DataFrame.
- Convert a Pandas, GeoPandas, Koalas, or Spark DataFrame to a dataset and add it to the data pane.
- Connect to databases that are not supported in Insights.
- Perform data analysis.
Capabilities of R scripting
R scripting can be used to do the following:
- Manipulate and prepare data.
- Create custom charts and graphs.
- Perform advanced statistical analysis.
- Convert a dataset to an R data frame.
- Convert an R data frame to a dataset and add it to the data pane.
- Connect to databases that are not supported in Insights.
- Perform data analysis.
Resources
Use the following resources to learn more about scripting in Insights:
- Insights Scripting Guide—Set up a Jupyter Kernel Gateway and view Python and R code samples.
- Connect to a kernel gateway.
- Use the scripting environment.