[Tutor] help with Pandas

Glenn Schultz glennmschultz at me.com
Tue May 22 13:13:31 EDT 2018


I have a dataframe with the column 'loanage' and a function to transform loanage, which will be part of a pipline, I am trying to apply the function to the data frame as follows:

df['loanage'].apply(myfunction(x = 2, y = 10, z = 10, df['loanage]), axis = 0)

I get value error: The truth in the series is ambigous.....

However, if I write a for loop indexing into the dataframe the function works.  I am of the understanding based on the docs and online research I should be able to do the above.  I cannot figure out what I am doing wrong and have tried every possible combination I have seen in the docs and online.  Any help is appreciated.


More information about the Tutor mailing list