• Skip to primary navigation
  • Skip to main content
The Data Lab

The Data Lab

Pruple button with the word menu
  • Business Support
        • Business Support

          We’ll help you harness the power of data so you can innovate and grow your business.

          Visit our Business Support page

        • Accessing Talent
          • Data Talent
          • Placements
        • Funding
        • Small Business Support
        • Digital Strategy
        • Academic Project Funding
        • The Data Lab Community
  • Professional Development
        • Professional Development

          We’ll help you harness the power of data so you can innovate at work and also advance your career.

          Visit our Professional Development page

        • Workshops
        • Online Courses
        • Data Skills for Work Programme
        • The Data Lab Community
  • Students
        • Students

          We’ll help you learn about the power of data and gain real-world experience and career-focused qualifications.

          Visit our Students page

        • The Data Lab Academy
        • PhD
        • TDL Academy Placements
        • Scholarships
        • The Data Lab Community
  • Partner With Us
        • Partner With Us

          We work in partnership with companies to help them gain maximum benefit from the strategic use of data.

          Visit our Partner With Us page

        • Collaborate With Specialists
        • Partnerships
  • About Us
        • About Us

          We discover opportunities, connect people and ideas, develop knowledge and expertise and bring game-changing data projects to fruition.

          About Us

        • Our Team
        • Careers With Us
        • Academic Opportunities
        • The Data Lab Community
        • Case Studies
        • News & Podcasts
        • DataFest
        • Scottish AI Alliance
        • Contact us

Keeping up to date with technical advances: Python versus Tableau for data visualisations

Tech blog 28/02/2018

Python is great, but…

Since taking up Python several years ago I’ve often thought of it as the Swiss Army Knife of programming languages. After successfully using it for webscraping, software development, number-crunching and data visualisation one achieves a certain level of comfort in knowing that, if you need to do it in code, you can probably do it in Python.

This mentality comes with a downside though. Whilst it’s great to have command of a language that can accomplish so much, there are times when one needs to realise that there are simply better tools available for a specific task. If you are writing high-frequency trading algorithms, for example, you would probably find that a compiled language such as C++ gets you to the front of the queue of short-lived market opportunities ahead of a Python bot. (OK, there is an argument that the Python bot is much quicker to write in the first place, but you get my point!).

Recreating a Python plot using Tableau.

One of the great things about working at The Data Lab is the ability to try out different technologies and keep on the path of constant learning. Having played around with Tableau here for some time I was impressed by its ability to cope with geographical data. Recently I was thinking what data set I could throw at it next and then remembered that my first post on the main website blog concerning the globe-trotting of James Bond would be perfect.

To recap the details: as a labour of love I collated information from various sources on the location of James Bond in each of the 24 canon films to date. From this I worked out the routes and therefore the total distances travelled. After presenting tabular information I then plotted visualisations by actor and film, and also of the global locations our hero has visited.

All of these graphs were created with the matplotlib and Basemap packages within Python. The graph of locations visited is shown again below:

The code to achieve this is relatively short. All that is required is to read in an Excel file containing the country latitude and longitudes together with the film count. This latter value is used to scale the data points. However, when one writes a new block of code for the first time there is always a certain amount of time taken to ensure one is proceeding correctly, and (in my case anyway) looking at Stack Overflow for any exemplars to follow. Trying to remember back 18 months, I would say that this one plot probably took me a couple of hours-worth of effort.

Fast forward to the present day when I have access to Tableau. The beauty of using this software is that I can now generate the following plot in under two minutes:

The first thing we can see is that the plot looks more professional, with a cleaner underlying world map. Admittedly we don’t yet have the full labelling on the data points like the Python plot, but using Tableau we get many more options to try out different views in a quicker and less cumbersome way.

For example, suppose that instead of using sized data points we wanted to colour the countries in proportion to their film appearance count. No problem! With literally one change on the marker type from “Circle” to “Map” we get this visualisation:

There are many, many more things we can do here, but we’ll leave an exploration of Tableau for another time. What I’d prefer to stress is that in exactly the same way Python removes much of the pain of programming in a lower-level language, Tableau performs the exact same abstraction when it comes to developing visualisations. The time saved can be used to perform many more iterations, or to try out several different ideas before presenting the information back to the end user.

What can we take from this?

The main purpose of this article is not to sell Tableau on it’s data visualisation abilities, nor is to disparage those of Python. What I wanted to highlight through this one simple example is how it is always important to keep an eye on the tools we use as data scientists and forever be on the lookout for new and better ways of doing things. Sometimes it is difficult to know whether a new tool or technique is simply a flash-in-the-pan, particularly in the open source world.

So how can we do this? Personally I tend not to be an early-adopter, opting instead to wait for a critical mass of users to know that stability and support have reached a certain level. To this end I find that it is crucial to keep one’s finger on the pulse by attending conferences, reading blogs and newsletters, and critically by just trying things out. All of the data scientists I have spoken to about this in my role at The Data Lab are fortunate in that the companies they work for encourage this type of exploration. The experimental mindset that the data expert brings to their daily tasks is exactly the same as is required to ensure that their employers will benefit from any new developments in software or hardware. If you own or work for a company that is not so forward-thinking then I would encourage you to take steps to address this. If the company down the road is taking advantage of opportunities that you are not, there is a real danger of missing out on the competitive edges that come within a fast-moving technical environment.

Tags: James Bond, python, Tableau

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Innovate • Support • Grow • Respect

Get in touch

t: +44 (0) 131 651 4905

info@thedatalab.com

Follow us on social

  • Twitter
  • YouTube
  • Instagram
  • LinkedIn
  • TikTok

The Data Lab is part of the University of Edinburgh, a charitable body registered in Scotland with registration number SC005336.

  • Website Accessibility
  • Privacy Policy
  • Terms & Conditions

© 2023 The Data Lab

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsReject AllAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-advertisement1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category .
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
CookieLawInfoConsent1 yearRecords the default button state of the corresponding category & the status of CCPA. It works only in coordination with the primary cookie.
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
CookieDurationDescription
_ga2 yearsThe _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
_ga_DPXX4XJSJ82 yearsThis cookie is installed by Google Analytics.
_gat_gtag_UA_54851888_11 minuteSet by Google to distinguish users.
_gat_UA-54851888-11 minuteA variation of the _gat cookie set by Google Analytics and Google Tag Manager to allow website owners to track visitor behaviour and measure site performance. The pattern element in the name contains the unique identity number of the account or website it relates to.
_gcl_au3 monthsProvided by Google Tag Manager to experiment advertisement efficiency of websites using their services.
_gid1 dayInstalled by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
CONSENT2 yearsYouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
CookieDurationDescription
personalization_id2 yearsTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.
VISITOR_INFO1_LIVE5 months 27 daysA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
YSCsessionYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
yt-remote-connected-devicesneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt-remote-device-idneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
CookieDurationDescription
cl-bypass-cache1 hourNo description
muc_ads2 yearsNo description
SAVE & ACCEPT
Powered by CookieYes Logo