How To Analyze Beyoncé’s Grammys Nominations & Wins With Python

How To Analyze Beyoncé’s Grammys Nominations & Wins With Python

02/03/2023
8 minutes

This Sunday is The Grammy Awards, and many of the biggest names in music — like Bad Bunny, Lizzo, and Taylor Swift — are nominated for awards this year. While we won’t know who’ll take home a gilded gramophone until Sunday, some of the nominees already have quite a few Grammys to their name.  

Beyoncé, for example, is poised to break some Grammys records. Beyoncé is already the most decorated female act in Grammys history, with 28 awards under her belt. This year, she claimed the most Grammy nominations with nine, including Album of the Year for Renaissance. If Beyoncé wins at least four of those awards, she’ll become the most decorated Grammy artist in history, in other words, the Grammys GOAT. 

This is a pretty major feat in music history, but Beyoncé’s impact is bigger than just her collection of awards and extremely catchy music. As a massive pop star and artist, Beyoncé has frequently used her platform to celebrate and promote Black excellence. Think: Hiring HBCU marching bands when she headlined Coachella in 2018, reimagining The Lion King in the 2020 visual album Black Is King, and paying tribute to Black queer artists in Renaissance.  

“As an artist, I believe it’s my job, and all of our jobs, to reflect the times,” Beyoncé said in a 2021 Grammys acceptance speech. “It has been such a difficult time, so I wanted to uplift, encourage and celebrate all of the beautiful Black queens and kings that continue to inspire me and inspire the whole world.”

Learn something new for free

To commemorate Black History Month and the Grammys, we’re putting Queen Bey’s Grammys accomplishments in perspective using programming tools we know and love: data science and visualization. You might be thinking, Why bother doing this when the music speaks for itself? Well, the best way to practice data visualization (or pretty much any coding language or skill) is to apply it to something that motivates you, says Eva Sibinga, a Codecademy Curriculum Developer in Data Science. “That can be for a fun reason or a serious reason, but if the project demands your attention because you’re passionate about it, you’ll push yourself to learn new things and grow your skills.”

Telling a story with data

Anytime you translate large amounts of information into something actionable, you’re engaging with data science. Broadly speaking, data science is a combination of probability and statistics, software engineering, and domain knowledge. 

Data visualization is the process of mapping, graphing, plotting, and charting data to discover relationships and patterns. “When I have a question or a hunch, I often want to see the answer laid out visually,” Eva says.“That means more to me than numbers without visuals, because data visualization allows us to show numbers in context and add richness to a simple calculation or statistic.”

Much like writing music, creating compelling data visualizations can be an art form. There are lots of different types of charts and graphs — like bar charts, histograms, and pie charts — that you can code to convey specific relationships in data. Deciding which type of chart will best illustrate your data findings and customizing it with color and other design choices is all part of the fun of being a data scientist. 

Data doesn’t have to come from fancy sources to be interesting or worth exploring. You just have to evaluate its quality and accuracy, not its academic pedigree.

Eva Sibinga
Codecademy Curriculum Developer, Data Science

Lots of data scientists work with the programming language Python and its data-specific libraries like Pandas, Matplotlib, and Seaborn. If you want to level-up your data science work in Python, data visualization is a great skill to explore next. You can learn the ins and outs of data visualization in the path Learn Data Visualization with Python

Never dabbled in data science before? That’s totally okay! We have lots of beginner-friendly data science courses and paths that you can explore. If you want to get more comfortable thinking about and analyzing data, start with the free course Principles of Data Literacy. For a more comprehensive and hands-on approach, take the path Data Science Foundations. In this path, we’ll teach you how to use go-to data science tools like Python and SQL to access, manipulate, analyze, and visualize data.

Analyzing Beyoncé’s awards using data visualization

One of the first steps in making a data visualization is to identify the type of data you want to visualize. In this case, we wanted to chart Beyoncé’s music career through the lens of Grammy nominations and wins and noms, from her first win in 2001 with Destiny’s Child, to her knockout 2016 album Lemonade, and everything in between. 

Okay, data, now let’s get in formation. We started creating our dataset by pulling information from Wikipedia lists, which are an excellent source for this kind of public information that’s not up to interpretation, Eva says. “Data doesn’t have to come from fancy sources to be interesting or worth exploring,” she says. “You just have to evaluate its quality and accuracy, not its academic pedigree.” 

We organized our information in a simple Google Sheet that included all of Beyoncé’s Grammy nominations organized by year, type of award, and whether or not she won. “Then we just had to make sure the information was cleaned so that the sheets for each artist we compared had the same columns,” Eva says. Using the Python library Pandas, we’re able to import a CSV file and use the library matplotlib to make our graph. 

Eva decided that a stacked bar chart would be the best way to visualize this dataset, because she wanted to show the counts of three categories (nominations, wins, and pending awards) over time. A bar chart is a simple and digestible way to communicate that information. We create a bar graph using the specific bar chart function, and add everything else to the graph using different general functions. 

Here we can quickly see the trajectory of Beyoncé’s Grammys career. Eva used the color parameter in matplotlib‘s plt.bar() function to customize the colors in the chart so we can differentiate the categories that are relevant to us. 

“When we talk about the Grammys, it’s usually about ‘wins’ and ‘nominations,’ so we want these categories to be easily distinguished in this graph,” Eva says. “Because we’re in the short window of time where some of the current data isn’t known yet, we have an additional category for pending awards.” The beige bars represent the nominations she received, the pink section is her Grammy wins, and the blue bar on the far right is for this year’s Grammys that haven’t happened yet. 

Well, we have one chart, but how can we tell how Beyoncé stacks up to other Grammy winners? We took a look at the other artists who are nominated for several Grammys this year for inspiration — like Adele, Mary J. Blige, and even Beyoncé’s husband and frequent collaborator Jay-Z. 

To date, Beyoncé and Jay-Z each have 88 Grammy nominations, making them tied for the title of most-nominated artist in Grammy history. Interestingly, the couple has been nominated together a total of 17 times and they’ve won five Grammy awards for their collaborative works. Let’s repeat this process with Jay-Z’s Grammys career. 

So, what can we learn from this graph? Right away, we can see that Beyoncé’s graph has a more classic “pop star” look to hers and Jay-Z has a more “producer” look, Eva says. What that means is Beyoncé’s wins tend to be concentrated at peak moments in her career when she released albums, whereas Jay-Z’s are more consistently split (except for 2018, when he went home empty-handed). 

We know that Jay-Z has an extensive career producing music by other artists in addition to performing and rapping his own work, so he’s eligible for more Grammys in more categories. “It seems like he is nominated more consistently for behind-the-scenes work — because his spikes don’t just correspond with heavily publicized albums,” she says. An artist as popular as Beyoncé, on the other hand, may not release new music every single year. 

The singer Adele, for example, is up for seven Grammy awards this year, including Album of the Year. But she’s only put out four albums in the course of her career, so her graph looks sparse. 

Let’s look at another multi-hyphenate artist, like singer and songwriter Mary J. Blige. Like Bey, Mary J. Blige has been included in the Grammys since the ‘90s, and she’s won nine awards to date. This year, she’s nominated for six Grammys, including Album of the Year for her 14th studio album, Good Morning Gorgeous. You’ll notice that her chart has the greatest range in terms of dates.

Notably, Mary J. Blige has collaborated with lots of artists in her career across a diverse range of musical genres — from R&B to country and classical. She’s also written songs for movie soundtracks and executive produced albums. “Her chart made me most curious to read about what she’s been doing over the last seven years where she had no nominations after lots of activity from 1996-2015,” Eva says. “Sometimes the absence of data is the interesting part!”

Ultimately, these awards graphs are just an entertaining way to take a different look at your favorite musical artists’ careers and apply data science to your daily life and interests. You could even do this with your favorite actors ahead of The Oscars! As you can see, there’s no limit to the types of interesting and relevant datasets you can explore with data science.

If music and pop culture isn’t your thing, check out all of the Codecademy data science projects that you can complete to practice applying your programming skills to real-life contexts. For example, in the case study Analyze NFL Stats with Python, you’ll build a machine learning model to predict the winners of NFL games (just in time for the Super Bowl!). The bottom line: There’s value in doing fun projects simply because they make learning easier and more enjoyable. 

Related courses

4 courses

Related articles

7 articles