I am trying to pass parameter to, and execute, a function within the Python tool. It is actually a function within a function. this is a specialized IRR calculation (it differs from the built in Alteryx IRR calculation). The code was "converted" from a VB custom Excel function (works fine there)
What I don't know is how to properly execute the function. Seems like Alteryx makes an attempt before erroring out
A simplified version is attached
Solved! Go to Solution.
HI @aaronindm,
I'd be lying if I said that I understand what you're doing. But I have got it to run without error. The issue, I think, is that data is read in and out of Atleryx as Pandas DataFrames, therefore you need to a few extra steps to extract the data from the DataFrame before you can use it in your function.
Take a look at the attached.
@PhilipMannering Thanks you for the reply but I am not seeing the additional code you added, can you call that out specifically for me? The Python tool code from the one I uploaded looks to be the same as the one you uploaded.
There is likely some nuance that I am missing
Hmm.... so this puzzled me a bit, but I think what has happened is that both workflows are pointing to the same folder for the the .ipynb file (the jupyter notebook). So updating the python tool in one "Becker_IRR_4.yxmd" will also change the python tool in "python tool troubleshooting.yxmd". So it looks like both are the same.
But what I changed was the comments, the location of data after Alteryx.read() and adding the result to a DataFrame before writing out in the final cell,
Now you get an output (0.003044), whereas before you got an error.
Wow thank you so much for this - works like a charm!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |