## Sign up to take part

Registered users can ask their own questions, contribute to discussions, and be part of the Community!

This website uses cookies. By clicking OK, you consent to the use of cookies. Read our cookie policy.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Registered users can ask their own questions, contribute to discussions, and be part of the Community!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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**

Solutions shown first - Read whole discussion

4 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Thanks for the response..

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

Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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

Didn't Find What You Needed?