ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

RandomNumberGenerator

  • Resumen
  • Descripción general del método
  • Métodos
  • Muestra de código

Resumen

Determines the type and seed that will be used to create random numbers between 0 and 1 for all tools that utilize random numbers, for example, CreateRandomRaster, CreateRandomPoints, and the ArcGIS.Rand() function.

Returned from the randomGenerator environment.

Descripción general del método

MétodoExplicación
exportToString ()

Exports the object to its string representation.

loadFromString (string)

Restore the object using its string representation. The exportToString method can be used to create a string representation.

Métodos

exportToString ()

Valor de retorno

Tipo de datosExplicación
String

The string representation of the object.

loadFromString (string)
ParámetroExplicaciónTipo de datos
string

The string representation of the object.

String

Muestra de código

RandomNumberGenerator example

Demonstrate how to create a random number generator object.

import arcpy

# Cannot create RandomNumberGenerator object directly,
# but is returned from CreateRandomValueGenerator function.
#
# CreateRandomValueGenerator takes 2 arguments, seed and distribution
# method. The distribution method options are ACM599,
# MERSENNE_TWISTER, STANDARD_C.
#
# The gen variable is a randomNumberGenerator object that is assigned
# to the randomGenerator environments setting.
#
arcpy.env.randomGenerator = arcpy.CreateRandomValueGenerator(20, "STANDARD_C")

# Calculate a random number using the arcgis.rand() function
result = arcpy.CalculateValue_management("arcgis.rand('normal 0.0 10.0')")

# Get the value from the result object and print it to the Python window.
val = float(result.getOutput(0))
print(val)

Temas relacionados

  • CreateRandomValueGenerator

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal