Replace python code with recipe
![Linda97](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar16.png)
Can I replace this code with recipe ?
i=0
for c in xxx:
if c not in Data_df.columns:
Data_df[c] = 0
Thanks
Answers
-
Shashank Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 27 Dataiker
Yes, you can convert this as a recipe, with the input dataset as the dataset you want to check the column "c" and output as the column with value "c" as 0
A recipe needs at least one output (Dataset, File , Saved Model etc.) associated with it.
-
Sv3n-Sk4 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 32 ✭✭✭✭
The way I understand your question @Linda97
is :Is there a recipe that will allow me to replace my existing code in the goal to fill every column you choose with a 0 ?
If I understood it correctly, you can use a prepare recipe and use the "Fill Column" processor and choose every column you want with a Value 0.
https://doc.dataiku.com/dss/latest/preparation/processors/fill-column.html
Hope it helped