01 Oct How to integrate Python with Tableau
It is no news that Tableau, as a business intelligence software, has made data visualization completely easy for both programmers and non-programmers. Python, on the other hand, is a programming language widely used in the world of data and it is most popular for its strengths in predictive analysis and machine learning. If somehow, we could possibly merge these two data analysis power tools together, integrate python with tableau; wouldn’t that result in a dream data science team for every organization?
In this article, I am going to walk you through how to leverage Python to enhance Tableau’s capabilities and use Tableau to visualize model outputs from Python. This integration completely eradicates the back and forth process of using Tableau to visualize data, going back to Python to structure the model, and bringing it back to Tableau again.
All of these can be done in one place using the Tableau + Python server, also known as the Tabpy server. So, sit tight, and let’s get right to it.
To integrate Python with Tableau Desktop, there are, of course, a few steps that must be followed:
Step 1: Install TabPy
- Download and install Anaconda. To do this, go to www.anaconda.com/distribution. Downloading Anaconda automatically installs Python and Pip for you. This will save you from the stress of trying to configure parameters for Tabpy.
- Open the anaconda prompt, type pip install tabpy-server, hit the “enter” button on your keyboard to install the TabPy server. This may take 3 to 4 minutes.
- Still, on the anaconda prompt, type pip install tabpy–client, hit the “enter” button on your keyboard to install the TabPy client. This may take 1 to 2 minutes.
- Next, type pip install tabpy to install TabPy. This step is mostly omitted but it is quite necessary, to avoid bugs later into the integration. This may take about a minute.
- Finally, type tabpy on the anaconda prompt and “enter”. TabPy starts and listens on port 9004.
Step 2: Integrate TabPy with Tableau Desktop
Now that we have the TabPy server up and running, the next thing to do is to integrate it with Tableau Desktop. To do this, follow these steps:
- Launch Tableau Desktop.
- Select “Help” in the top menu bar to display a dropdown menu.
- Click “Settings and Performance” in the dropdown menu displayed.
- Select the “Manage External Services Connections” option to display a popup.
- In the popup displayed, fill in the following details:
Host Name: Local Host Port: 9004
Select the Test Connection button to integrate TabPy with Tableau Desktop.
Once connection is successful, it only means that you have successfully integrated Python with Tableau using the TabPy server.
If you find this walkthrough helpful, please share. You can also leave a comment in the comments section if you have any question(s).