Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Python Tool

Shyam12
7 - Meteor

My aim is to feed the output of the python tool as the data input to the "input tool".

My python tool returns a csv file as an output. How do I feed this file into the Input tool ?

6 REPLIES 6
ImadZidan
12 - Quasar

Hello @Shyam12 ,

 

It would be better for your Python Tool to output a dataframe and use it as a driver to the rest of the workflow.

If you share the python script, we will help to get it to do that.

Shyam12
7 - Meteor

Please find the attached python file that I use to get the csv file. The file format wouldn't accept a .py file and hence the .txt file of the code

ImadZidan
12 - Quasar

Hello @Shyam12 ,

 

I apologise for the delay. was having trouble installing tweepy.

 

Have a look at the attached workflow. the structure is there. you need to add your credentials to the API call.

 

if you are having trouble installing tweepy. uncomment the !pip install tweepy, run it and comment it out again and rerun.

 

I hope it gives you an idea.

Shyam12
7 - Meteor

Thank you so much !!! 🙂 

 

Shyam12_0-1614884795678.png

I am getting the mentioned error. Can you please help me getting this fixed ? Kindly help.

ImadZidan
12 - Quasar

@Shyam12 ,

 

Of course. First after you have added your stuff. Did you run the workflow?

 

This error implies that no data is coming out in the df dataframe..

 

If you have jupytor notebook, please run the code and see if the dataframe contains records.

 

replace Alteryx.write(df,1), with just df when you run outside Alteryx.

 

 

Shyam12
7 - Meteor

Thank you Imad. It now works perfectly. Thanks again for all the help.

 

Cheers

Shyam 

Labels