Frequently asked question

Why must functions be assigned to a variable?

Last Published: April 26, 2020


The functions are temporary, therefore, the function must be assigned to a variable. Otherwise, the output does not persist, and is unusable in scripts.

A variable holds references to data. In this example, the raster object created with an function is stored in a variable named Solar.

import arcpy;
from import *;

arcpy.CheckoutExtension ("Spatial"); #Code used to check the extension in ArcMap

Solar = (inRaster, latitude, time);
# the code segment uses the

The output raster is temporary by default. Due to the volatile nature of the output raster, it must be assigned to a variable to retain the output raster value.

Article ID:000012410

  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic