![create sampling grid arcgis 10.6 create sampling grid arcgis 10.6](https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41597-020-0410-1/MediaObjects/41597_2020_410_Fig1_HTML.png)
CREATE SAMPLING GRID ARCGIS 10.6 CODE
In the code block, import the random module using the expression import random. To generate a random float number between a and b (exclusively), use the Python expression random.uniform(a,b).
![create sampling grid arcgis 10.6 create sampling grid arcgis 10.6](https://media.springernature.com/m685/springer-static/image/art%3A10.1038%2Fs41597-021-01052-0/MediaObjects/41597_2021_1052_Fig1_HTML.png)
To generate a random integer between a and b (inclusively), use the Python expression random.randint(a,b). Third, use the Calculate Field tool to assign random values to the empty field in the random points feature class. Suggested field types are long integer or float.
![create sampling grid arcgis 10.6 create sampling grid arcgis 10.6](https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/GUID-67679610-FFF2-48E3-8F2D-E2F034834242-web.gif)
Second, use the Add Field tool to create a new numeric field in the random points feature class. To assign random values to randomly placed points, first generate random points using this tool. Output Coordinate System geoprocessing environment if it is set (and overrides all other behaviors detailed above).Feature class if a constraining extent is specified in Python by using the path to a feature class.Map data frame if a constraining extent is specified in the map using a layer in the map or the path to a feature class.Constraining feature class if one is specified.The coordinate system of the output feature class will be the coordinate system of the If you are using a constraining feature class that has more than one feature, and you wish to specify the total number of random points to be generated (as opposed to the number of random points to be placed inside each feature), first use the Dissolve tool so that the constraining feature class only contains a single feature then use that dissolved feature class as the constraining feature class. If the number of points is supplied as a number, each feature in the constraining feature class will have that number of random points generated inside or along it. The field option is only valid for polygon or line constraining features. The Number of Points parameter can be specified as a number or as a numeric field in the constraining feature class containing values for how many random points to place within each feature. The area in which random points will be generated can be defined either by constraining polygon, point, or line features or by a constraining extent window.