sequence generator in prepare receipe
![obireddy](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar24.png)
obireddy
Registered Posts: 13 ✭✭
Hi Team,
Good Morning.
I want add new column to dataset where I need to fill data as unique sequence data combination of both string and numbers like AB1,AB2,AB3, XYZ1,XYZ2,YX1 like.
How can I add new column with data like above.
Thanks in advance.
Tagged:
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,876 Neuron
Use a Prepare recipe and Formula processor. You can combine other column values.
-
Rahulvk Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 2 ✭
Here is the python code
Import pandas as pd def alpha_sequence(n): return ['ab' + str(i) for i in range(1, n+1)] n = 10000 sequence = alpha_sequence(n) df = pd.DataFrame(sequence, columns=["Unique_id"])
-
How can I put this code in to prepare recipe, to generate sequence numbers for new column?