SPLIT & PREPARE RECIPE

shahas71
Level 2
SPLIT & PREPARE RECIPE

Hi All,

I have a task to create a split recipe as well as a prepare recipe & has to be automated using python code.

I'm new to Dataiku & would like to know how it can be done.

The model data can be assumed as follows :

we have 20 columns of which only 4 needs to selected. This data needs to split as per the following rule :

column a column b column c

a               -                 -

a               b                -

a               b                c

-                 b               c

-               -                  c

 

The above dummy data first has to be separated based on the below rule and then the multiplication has to be implemented :

Rule 1 : if there is only a in column, & some other values in other columns, then multiply everything by ab

rule 2 : if there exists a & b, then multiply by xy

rule 3 : if a, b, c then multiply by xyz

rule 4 : b & c, then multiply by cd

rule 5 : only c, then multiply by xz

rule 6 : if none, just multiply by abc

note : if a condition satisfies, multiplication has to be implemented on all the values in that row.

The first step should do this process & it has to be using a python recipe & shouldn't require constant changes nor get too complicated, as it needs to understood by users with basic knowledge.

Hope the question is clear. 

Thanks in advance


Operating system used: windows

 

0 Kudos
4 Replies
Turribeach

Hi, welcome to the forum. What part of your question do you need help with? How far have you got? Any errors/issues?

0 Kudos
shahas71
Level 2
Author

Hi, 

 

Thanks for the response..

 

Yet to find any solution. Would appreciate any lead for the same

 

Thanks in advance

0 Kudos
Turribeach

I asked chatGPT and this is what I got, should give you some ideas and get you started.

Screenshot 2023-08-28 at 21.02.28.pngScreenshot 2023-08-28 at 21.02.57.png

0 Kudos
shahas71
Level 2
Author

heyy @pturp thanks for the response. but this doesn't work.

What I'm trying to do is to use python code as the initial step inside a prepare recipe to filter out the data & do some calculation at the initial step. But getting error like dataiku is not defined etc..any methods that has to be followed so as to write python code inside a prepare recipe???

 

Thanks 

0 Kudos