MIP Logo

Can you use Python in Alteryx?

python alteryx

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here. 

INTRODUCTION

Alteryx is a powerful software capable of performing different tasks. One can create a full Data Science pipeline from data collection, data engineering, modelling using available models, calculate the metrics of these models and compare these models to each other. In addition, if you want to try new algorithms that are not available in Alteryx yet but the Python already has them, you should try the Python tool. In other words, you can integrate your Python script into your Alteryx workflow, and we will consider how to do so in this post.

PYTHON TOOL 

A developer can find the Python tool by typing python in the search field. By pressing on the Python tool, you obtain the following interface:

python

You can see the Python tool on the Canvas, and on the Configuration window, you can find Jupyter Notebook. The developer can run cells within Jypyter Notebook the same way as Jupyter notebook is not in Alteryx using button run and others. To install Python libraries, one needs to uncomment the following line: #Package.installPackages([‘pandas’,’numpy’]) and add the desired Python library. For example, to add the sklearn library, it is necessary to write: Package.installPackages([‘pandas’,’numpy’, ‘scikit-learn]’). 

To read a dataset from the incoming connection, one needs to write:

df  = Alteryx.read(‘#1’)

where #1 is the number of incoming connections. To write data to one of five output anchors, a developer needs to write:

Alteryx(df,2)

where df is the dataset to output and 2 is the anchor number.

CONCLUSION

Alteryx gives you a very flexible opportunity to add Python script into the Alteryx workflow compared to competitors. You may not need the Python tool when you work with data on a daily basis, but it is a good tool to have in your arsenal.

 

Share this post