ArcGIS Pro - Generate Random Number in Python and Arcade

Опубликовано: 03 Март 2026
на канале: GIS Coordinated
4,708
like

Video #95
In this video I demonstrate how to use Arcade script and python to create a random number.
Add Field is used to create a new empty field
The Field Calculator is then used to generate the random number, first with Arcade and then with python 3

With Arcade you use: random()*500 - for random values up to 500
With python you can use random.randint(0,500) but you also need to import the module: import random in the code block.

A slightly more complex example of using Python codeblock is available here:    • ArcGIS Pro - Using Python Codeblock in Cal...   which uses IF...ELIF statement in ArcGIS Pro 3.

And this video has more on generating random values (using strings):
   • ArcGIS PRO Generating Random strings  

Also, if you want to generate a truly unique, complex value, watch this video:    • ArcGIS Pro - use UUID to generate a truly ...