Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Adds a column of deterministic pseudorandom numbers to a collection. The outputs are double-precision floating point numbers. When using the 'uniform' distribution (default), outputs are in the range of [0, 1). Using the 'normal' distribution, outputs have μ=0, σ=1, but have no explicit limits.
The input collection to which to add a random column.
columnName
String, default: "random"
The name of the column to add.
seed
Long, default: 0
A seed used when generating the random numbers.
distribution
String, default: "uniform"
The distribution type of random numbers to produce; one of 'uniform' or 'normal'.
rowKeys
List, optional
A list of properties that should uniquely and repeatably identify an element of the collection, used to generate the random number. Defaults to [system:index].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-01 UTC."],[[["`randomColumn()` adds a new column of pseudorandom numbers to a FeatureCollection, with the default column name being \"random\"."],["The generated random numbers can follow either a uniform distribution (\\[0, 1)) or a normal distribution (μ=0, σ=1) specified using the `distribution` parameter."],["Users can provide a seed value for reproducibility using the `seed` parameter, ensuring the same sequence of random numbers is generated for a given seed."],["This function is commonly used for tasks like randomly splitting a FeatureCollection into subsets for training and testing machine learning models, as demonstrated in the examples."]]],["This tool adds a column of pseudorandom numbers to a FeatureCollection. Users can specify the `columnName`, `seed`, and `distribution`. The default distribution, 'uniform', generates numbers between 0 and 1; 'normal' produces numbers with a mean of 0 and a standard deviation of 1. The `randomColumn` method returns the modified FeatureCollection. This is exemplified by creating random splits into subsets. The outputs are double-precision floating point numbers.\n"]]