The Snake Installation
"Needs Python to run program," I wanted to avoid snake photos! PC: Programming memes

The Snake Installation

Googling the word "python" returns an interesting array (pun intended) of image results, like snake photos, code snippets, and Python language icons. While I don't like snakes, I, fortunately, don't have ophidiophobia either. This means I can easily scroll past the close-up shots of constrictor snakes to get the Python programming language graphics I want to use.

Python in Power BI

It's important to point out that while knowing Python can be helpful in using Power BI, it absolutely isn't required. In fact, I think that if you're a Power BI developer, there's far more of an impact from learning DAX than there is from learning Python. They are different languages with different uses. That's not to say that learning Python isn't useful. But rather, if you have to learn one language, DAX likely takes less time to learn (at least initially) and has a much bigger impact specifically in Power BI.

However, I still love Python. I could write code in it all day if I wanted to. I use Python for querying online data sources (APIs and zipped folders for example) to create useable data tables. I also use it to run algorithms or machine learning models quite a lot. I sometimes use it to create data visualizations. I definitely use R more often than Python though to build data visualizations, both within Power BI and in external IDEs (Spyder or RStudio for example).

No alt text provided for this image

In the Power Query Editor

In one of the latest videos in my Power BI Weekly serial course, I illustrate how to use Python to create a new query in Power Query by initially choosing the Python script data connection option. While this example initially looks like a single process script, it really breaks down into four steps.

  1. Connect to the data source.
  2. Run a Python function (that I created) on it to get the temperatures for each location.
  3. Aggregate the temperatures into a daily average for several locations in the Los Angeles area.
  4. Finally, run an anomaly detection algorithm on the data to determine which of these days represent anomalies for the daily temperatures.

No alt text provided for this image

We can also use Python to run a script on an existing query within Power Query. In an earlier video for this same serial course, I show how to push an existing data table into Python code to run as an applied step of its own in a query we already started building and transforming. Note the issue with using dates between Python and Power BI (more specifically for the M language) that I point out in this video. But don't worry! I do show one way around it within the video as well.

No alt text provided for this image

In the Visualization Pane

While I'll admit that I like the R language visual options (especially with the ggplot2 library) more than the options in Python, there are some great ways to use Python to create visuals that otherwise wouldn't be possible in Power BI. One example of this is a dendrogram. I use this tree-like heatmap visual to visualize the outcome of the hierarchical clustering algorithm in another one of my earlier Power BI Weekly videos.

No alt text provided for this image

Here's what this data visualization actually looks like in the example for this video. It's one of my favorites! There's something about the combination of the color gradient on the rectangles and the lines that show how closely related these rectangles are that makes it an especially impactful visual.

No alt text provided for this image

Supported Libraries

While the use of Python can increase our Power BI capabilities, it's also important to note its limitations. There are specific Python packages/modules/libraries that the Power BI service explicitly supports. That's not to say that others won't run when we run Python scripts in Power BI (especially for Power BI Desktop, which runs on the Python version we install on our own computer). But rather that these are the ones supported in the Power BI service when we upload our models.

No alt text provided for this image

For those wondering, I use pandas probably more than any other library, regardless of whether it's supported or not in Python (thankfully it is). I use scikit-learn (also known as sklearn) quite a bit as well to run algorithms on the data, especially once I create a useful pandas DataFrame object. For visualizations, I use matplotlib a bit, but I like the way the output appears from seaborn more. The thing is though, that seaborn is a wrapper that goes around matplotlib as well. Power BI requires us to install both the pandas and matplotlib libraries for Python to run within the application.

The options for R came out before Python within Power BI, which is perhaps why there are over 900 R libraries officially supported in the Power BI service, compared to only 8 for Python. If I were to describe my own learning process for the Python language specifically, it would look approximately like the steps below. There isn't only one way to learn skills or a language like this either. Even one single person can take many potentially different paths to learn the same skill!

No alt text provided for this image

More Algorithms

Python isn't the only programming language that I use a lot. The project at hand is the most common determinant of what tool (or tools) I use at any given point in time. But Python is one of my favorite tools to use either way!

Once I learned one programming language, it was much easier to pick up other languages because there's a lot of overlap between them both from the high-level concepts to the way of thinking about how to approach solving a problem. It's interesting how people that come from different backgrounds approach programming because what's easy for one person may be hard for someone else and there's nothing wrong with that either. Knowing how to use algorithms in Python is what makes it (and any other programming language) exciting to use. Here's a course that I love on algorithms in programming (not just Python) from fellow LinkedIn Learning instructor Joe Marini!

No alt text provided for this image

Coming Up

I'm excited to share that I'm currently working on a time series course for the LinkedIn Learning library. I'm looking forward to sharing more about this course when it comes out as well as future Power BI Weekly videos. Please subscribe to this newsletter to learn more! And keep learning! I'm always learning something new myself too!

-HW

It gets even more interesting when the user is asked to install anaconda to learn more about python. lol.

Like
Reply

When the user will install anaconda, they will have a snake family!

Like
Reply

Imagine if that person saw a similar message for R. “It’s telling me to find a pirate to run the program.”

To view or add a comment, sign in

More articles by Helen Wall

  • Testing Translytic Tasks

    Power BI predominantly consumes data. We connect it to data sources (which includes a wide variety of data source…

    2 Comments
  • Power B(AI)

    When OpenAI's ChatGPT interface debuted to the public at-large almost three years ago, it seemed enigmatic. We could…

    23 Comments
  • Power BI for $$$

    Happy Birthday Power BI! Power BI turns 10 today (July 24, 2025)! I started using the tool not too long after it first…

    5 Comments
  • Flying on Autopilot

    I remember taking a plane flight several years ago with a roller coaster landing. It was an otherwise uneventful short…

    2 Comments
  • Releasing Snakes into the Wild

    This week brings big news in both the Excel and Python communities! Python in Excel is now generally available as of…

    4 Comments
  • Slithering Back In

    I'm finally catching up on the latest editions of my newsletter after a bit of a break. Writing newsletters or any kind…

    2 Comments
  • The Modern Updates

    As I was perusing potential updates for my home recently, I started to think about how the definition of "modern" will…

  • WINDOWs of the World

    It's really hard to get very far in data science without knowing SQL. Within SQL there are different levels of…

    3 Comments
  • Straightening Things Out

    When I took linear algebra in college, my favorite part of the class was the end of it. The course was highly…

    2 Comments
  • SWITCH It Up

    In order to master managing data models, learning how to leverage conditional logic is a must. We see conditional logic…

    3 Comments

Others also viewed

Explore content categories