Applying a function to each row of a dataframe and storing outputs in the same or a new dataframe

Usersyed
Level 3
Applying a function to each row of a dataframe and storing outputs in the same or a new dataframe

I have a dataframe in which I want to apply a function to every row of the dataframe. This function is user defined and returns multiple values. I tried returning the values as a series and saving the values in new columns of the same dataframe but I end up getting an error. Any idea how to go about this?

This approach works fine as a standalone python script but it is failing when I put it in Dataiku as a recipe

0 Kudos
2 Replies
CatalinaS
Dataiker

Hi @Usersyed,

Can you share more details about your issue? What error are you getting?

Can you share also the python script that is working and the code that is failing when using it in a recipe?

0 Kudos
Usersyed
Level 3
Author

@CatalinaS 

Thanks Catalina. My code had few errors. I fixed them and I was able to get the output.

0 Kudos