Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi All,
I want to create column with random values from list.
List values = test1,test2,test3 etc
I want to insert above values randomly.
Example-
Column1(Coming from DB) Random values
1 Test1
2 Test3
3 Test1
4 Test2
5 Test3
Operating system used: windows
You can do this in many ways. One that I think is neat is to use a Python processor in a Prepare step:
This is the sample code, modify it according to your needs as you see fit:
import random
def process(row):
my_list = ["test1", "test2", "test3"]
return random.choice(my_list)
You can do this in many ways. One that I think is neat is to use a Python processor in a Prepare step:
This is the sample code, modify it according to your needs as you see fit:
import random
def process(row):
my_list = ["test1", "test2", "test3"]
return random.choice(my_list)