Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

pandas.DataFrame.apply in alteryx

mgimpel
7 - Meteor

I am using the python connector in alteryx and was trying to use apply on a dataframe to edit the data of every row. Alteryx seems to be using the same value for each row though and is not applying based on the unique value in each row.

I have run the same code in a jupyter notebook outside of alteryx and there it is working as intended i.e. function is being applied to each value in that row. Is this an issue in alteryx that DataFrame.apply is not working correctly? I am using Alteryx Designer 2021.3

Thank you

5 REPLIES 5
clmc9601
13 - Pulsar
13 - Pulsar

Hi @mgimpel,

 

Are you using AMP engine? Try turning AMP on or off, respectively, and see if that makes a difference.

Are you able to recreate the problem with another or simpler code? Can you please share the recreated (or your original) code with us?

 

We will be able to help better with a little more information. Thanks! 

mgimpel
7 - Meteor

Here is a simplified example of the issue. The output I get is always for name=Michael whereas when I run this outside of Alteryx I get the correct data for each name respectively.

TheOC
16 - Nebula
16 - Nebula

hey @mgimpel 
I've got the same issue as you - tried with your example.

The issue is actually the version of Pandas, that Alteryx uses. Alteryx uses version 1.1.0 by default.
This makes sense looking at the documentation:
https://pandas.pydata.org/pandas-docs/version/1.1.0/reference/api/pandas.DataFrame.apply.html?highli...

To upgrade this, you can use "Package.installPackages(package='pandas',install_type='install --upgrade')".

I've added this to your code, and it seems to work perfectly fine now. Please find attached.

Hope this helps!
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
mgimpel
7 - Meteor

Thank you.

TheOC
16 - Nebula
16 - Nebula

Not a problem,

Happy Alteryx'ing!
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Labels
Top Solution Authors