Benefits of Python for Marketers

Email Marketing, Technical

Benefits of Python for Marketers Why in the world would you want to pursue something as difficult as learning how to program–especially when most of your time is already wrapped up in meetings, writing new copy, optimizing current campaigns…not to mention the life you have outside of work? Like any good marketer, you want to understand the ROI of investing your time, so you might be asking yourself “What’s in it for me?”

Learning how to program is extraordinarily intimidating. Some people might have even given you the impression you need a special “talent” to learn such a thing (but, know that people who say things like that are full of it).

One of the most applicable programming languages for marketers is Python; R is another, but this is not the place to debate either/or (if you want to do that you can hit me up on Twitter). The overarching goal of this plan is to present Python in a way that is relevant to marketers.

Yes, you can learn Python

There are many, many resources for beginners to learn Python, but most are oriented towards those who already have a background in engineering, in the sciences, or for “dummies.” The first two options are full of examples completely unrelated to marketing, and the latter just rubs me the wrong way (I may be biased, but if you’re reading this blog I’m pretty sure you’re not a dummy!).

But, if:

  • You are not afraid of computers
  • You are familiar with a spreadsheet program (like Excel)
  • You have the discipline to follow through
  • You want to do this

then it is absolutely possible.

While we will not go as far as learning true computer science or “real” programming, the goal with this series is to give you enough tools and information about Python to make your job easier by removing manual steps from data reporting and analytics.

What Python won’t help you with

Lately, coding has been portrayed as a panacea for all problems, but let’s be real for a second. Here are a few things learning Python will not accomplish:

  • Unless you are well-versed in how to do artificial intelligence, it will not write copy for that new ad campaign you are tasked with planning.
  • It will not automatically create brand new, pixel-perfect email templates for announcing that new product.
  • It will not attend meetings for you.

With that out of the way, here are some obstacles that I’ve observed learning how to program can help overcome.

If you are drowning in spreadsheets, it can be a life raft

There are too many data sources. A report that summarizes monthly performance can require going to 8 different sources, each with their own CSV/Excel file you have to download then merge together. Python can speed up that process.

Sometimes the data you have is too large to fit into a spreadsheet program; sure that 80 MB Excel file might open, but good luck sorting that one worksheet with all the VLOOKUP formulas. It mostly depends on how new/powerful your computer is, but in the majority of cases, Python wouldn’t break a sweat dealing with 80 MB of data.

Spreadsheet programs are not easily replicated. Although it is straightforward to download a couple of CSV files and merge them together once, if you need to do that weekly (or even daily), you start wasting a lot of your precious time on pointing and clicking instead of getting other work done. And if you are already using macros in Excel or the QUERY command in Google Spreadsheets, you’re basically starting to program anyways, so why not go all the way?

Tools can be expensive, but if you have the time, learning Python can be cheap

There are numerous tools that claim to solve all the issues listed in the previous points. However, there are many companies that cannot afford to shell out thousands of dollars a year for analytics tracking, data warehousing, and sophisticated visualization tools. Open-source (aka free) software such as Python or R can be a life-saver.

Knowing how to program can help you create your own momentum

Source: https://xkcd.com/1425/

If you know a little bit about programming, you can start to translate that knowledge into other areas. For instance, your JIRA tickets outlining a project that a developer needs to work on might become, from the developer’s point-of-view, a lot more clear. And, conversely, you might be able to better understand why a developer gives you an answer for why the project will take so long.

You can jump in to do the work yourself. If deploying your own code is not against company policy, you have the support of the developers at your company, and if you know enough programming, you can hop in and finally modify that H1 text that you’ve always wanted changed, but for some reason never gets done.

Sometimes having this type of knowledge can give you an advantage when it comes to job growth since there are jobs that require marketers to have a more technical background due to the technical nature of the product they need to sell. Keep in mind that while it is not guaranteed your career will benefit from learning programming, it will at the very least increase your skill set.

The last point above brings up one final thought:

Sometimes committing to something difficult has benefits that you don’t expect.

This is more of an intangible and vague reason, but I believe it’s worth getting a little more philosophical. For instance, why train in ballet for 10 years if you’re never going to be a principal dancer with New York City Ballet? Or why learn how to program or even go so far as reading through an introductory book to computer science when you will never become a full-fledged software engineer?

Sometimes the discipline, friendships, and lessons you learn along the way make it so that while you never “succeeded” in a particular field, you still gained something valuable from the experience. Hopefully, even if you don’t become a full-time programmer, going through this exercise will have more than just the benefits listed above.

If you’ve been thinking about how programming can help your marketing efforts, but have been intimated about coding, the posts still to come will allow you to take on more intermediate topics, followed by a few advanced projects that many marketers would commonly encounter.

Programming for marketers series outline

This blog series will go through enough basic Python to start taking on more intermediate topics, which will be followed by a couple of analysis projects. Here is an outline of the lesson plan and what you can expect in coming posts.

  1. Installing Python
  2. Getting Started:
    1. “Data type” is a thing in Python, and because it determines what you can and cannot do with your code, it’s really worthwhile to learn about it
    2. Variables, lists, and dictionaries help a computer remember stuff so you don’t have to
    3. A computer needs help making decisions and “flow control” in Python can tell it what steps to take next
    4. Functions are chunks of code you can reuse so you’re not always repeating yourself
    5. Making errors is common but they are learning experiences that will make you a better person…and programmer

3. Intermediate:

  1. CSV files are little monsters that Python can help you conquer
  2. Sometimes data is locked away in the HTML of a website so it’s probably a good idea to know how to set it free
  3. Databases are goldmines of valuable data and going through the pain of successfully connecting to them is worth the effort
  4. More and more marketing tools offer reporting APIs, so let’s learn how to use one

4. Advanced 

  1. An introduction to the Numpy & Pandas libraries and how they are sort of like having a spreadsheet program in Python:
  2. Data is dirty, and “munging” is basically the bath of the programming world
  3. Data with dates is called a time-series, and (you’ve got to trust me on this one) dealing with time-series deserves its own post
  4. There are so many different data sources, being able to merge them together will make you a superhero
  5. Once you’ve learned how to merge data together, it’s helpful to understand different ways to summarize it
  6. Before you start reporting, it’s a good idea to do some exploratory analysis to know what you’re really dealing with
  7. I can’t think of many reports that can go without some graphs, so let’s learn how to visualize data

Resources

Finally, it’d be disingenuous not to give credit to many of those who helped guide the content of this course through their own work in teaching others to program and I encourage you to check these resources out while you’re learning Python:


Adrian Palacios
More Posts by Adrian
Adrian has been working in web analytics for over ten years, both agency-side and in-house at tech companies. He currently works as the Senior Web Analyst for the Revenue Marketing team at SendGrid. As with anyone who has spent some time living in Brooklyn, Adrian has jump-started his own side-project and is the founder of the slow-analytics movement, an ethos driven by creating artisanal, hand-crafted analyses and has found that Colorado is the perfect setting for this version of farm-to-table reporting.