RandomNumericSelect / New Layer
Create a new column by randomly sampling from a predefined set of values, similar to numpy.random.choice() or sample() in R. Each row gets a randomly selected value from the provided list of Values
. Useful for generating categorical numeric data, simulation of discrete events, or creating test data with specific value constraints.
ColType
oneofValues
[f64, ...]List of 64-bit double-precision values to sample from. Must contain at least one value. Provides about 16 decimal digits of precision. Ideal for scientific measurements or financial data.
Values
[f32, ...]List of 32-bit single-precision values to sample from. Must contain at least one value. Provides about 7 decimal digits of precision. Good for general-purpose floating-point sampling.
Values
[i64, ...]List of 64-bit integer values to sample from. Must contain at least one value. Range: -2^63
to 2^63-1
. Useful for large identifiers or timestamps.
Values
[i32, ...]List of 32-bit integer values to sample from. Must contain at least one value. Range: -2^31
to 2^31-1
. Common for general-purpose integer sampling.
Values
[i16, ...]List of 16-bit integer values to sample from. Must contain at least one value. Range: -32,768
to 32,767
. Good for small-range discrete values like years or scores.
Values
[i8, ...]List of 8-bit integer values to sample from. Must contain at least one value. Range: -128
to 127
. Perfect for small categorical data like ratings, grades, or single-byte codes.
Values
[u64, ...]List of 64-bit unsigned integer values to sample from. Must contain at least one value. Range: 0
to 2^64-1
(18,446,744,073,709,551,615). Ideal for large positive identifiers, timestamps, or microsecond precision time data.
Values
[u32, ...]List of 32-bit unsigned integer values to sample from. Must contain at least one value. Range: 0
to 2^32-1
(4,294,967,295). Common for positive counts, indices, or millisecond timestamps.
Values
[u16, ...]List of 16-bit unsigned integer values to sample from. Must contain at least one value. Range: 0
to 65,535
. Suitable for small positive counts, port numbers, or year data.
Seed
oneofUse system-provided randomization. Each execution produces different boolean values. Suitable for security-sensitive applications, cryptographic operations, simulation, and cases where true randomness is required.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.