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 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.
Use a Prepare recipe and Formula processor. You can combine other column values.
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?