Like many other people, my first steps into the world of data were taken wearing the shoes of a Tableau developer. As the Tableau skills increased, so did my exposure to other things like SQL and Python.

Over time, learning more about these adjacent tools enhanced my day to day capabilities. As I learned more SQL, I better understood how to optimally feed data into Tableau. That enabled me to take more ownership of the wider data flow, beyond Tableau itself.

Python was a natural next step. It offered flexible control over the Tableau ecosystem via the Tableau Server REST API, and the syntax was straightforward.

Having enjoyed the taste of what Python brings to the table in terms of processing data, building visuals, and creating predictive models, I want to encourage others who are fluent in Tableau but don’t yet feel comfortable with Python to try it.


Step 1: skipping the basics and avoiding tutorial hell

We’re not going to cover the absolute basics of the Python language here. If you’ve ever learned another spoken language, this would be somewhat like studying all the nuances of grammar before understanding how to greet someone or how to say ‘yes’ and ‘no’.

If you want to dive into the building blocks of Python, I highly recommend working through some of this classic (and free) material until you feel like you feel confident.

I encourage you to think of Python as a tool that’s valuable from the start, rather than as a language you need to master before using. With that, lets’s dive in!

Step 2: feeding the pandas

If you’re working with Python and data, one of your best friends is going to be the Pandas package.

For your first date with Pandas, we’re going to revisit something every Tableau developer is familiar with: the Global Superstore dataset! Just download the file and save it in the local directory of wherever you’re running your python notebook/file.

Here’s how simple it is to feed that data into Pandas:

import pandas as pd

store_df = pd.read_excel('Global Superstore.xls')

The lines of code below do the following:

  1. import the pandas package, which we alias as ‘pd’.
  2. load the ‘Global Superstore.xls’ file, which is an Excel file, into a variable named ‘store_df’

Without getting into too many details, it’s worth noting that a common thing in the data world is a notion of ‘dataframes’. If you’re curious why we have housed our data into a variable named ‘store_df’, you can think of this as ‘store dataframe’. The common abbreviation for ‘dataframe’ is ‘df’ in the Python world.

#tableau #python #data-science #data-visualization

A gentle introduction to Python for Tableau Developers (Part 1)
1.10 GEEK