Skip to content
Glitter Text

Glitter Text

Personal Loan Solutions

Primary Menu
  • Finance Marketing
  • Enterpreneurship
  • Business Analyst
  • Business Ideas
  • Accounting
  • Advertise
  • About Us
    • Advertise Here
    • Contact Us
    • Privacy Policy
    • Sitemap
  • Home
  • Ballpark figures: Analyzing MLB baseball attendance
  • Business Analyst

Ballpark figures: Analyzing MLB baseball attendance

By Keli W. Rodriguez 4 years ago

[ad_1]

It is springtime in the U.S., which means something as American as apple pie is back: baseball. And since there’s all kinds of great data around one of the country’s great pastimes, we decided for this week’s post to look at Major League Baseball (MLB) attendance statistics from the last 20 years, which is published on many websites including the one we used to get the data you’ll find in the charts below: ESPN.com.

To collect the attendance data from ESPN, we used Jupyter Workspaces (currently in beta in Domo) and the Python package Beautiful Soup to parse the HTML. And since Domo can now schedule code in Jupyter Workspaces to run regularly, you can be sure that this page will continue to update with the 2022 data.

The first thing you’ll probably notice when looking at the data is that 2020 is missing. That’s because, due to the pandemic, baseball was played without fans that year. There was a bit of a return to normalcy in 2021, but it wasn’t until this season that all spectating restrictions were lifted, so it will be interesting to watch how attendance rebounds (though, in full transparency, we only have the data for full years right now, so we are not capturing any data related to seasonality, such as how weather or a team’s place in the playoff race affects ticket sales).

One good way to review this data is with an old favorite of many data scientists: a box and whisker plot. The chart shows the minimum and maximum average attendance for each team in the whiskers (the top and bottom lines). I have sorted this to show the team with the highest peak attendance year on the left, and the lowest on the right:

Where the visualization gets more interesting for me is with the box elements. Each box shows the space between the 25th and 75th percentiles, which is meant to reflect how much a team’s attendance has swung over the years. The bigger boxes tell me those teams (such as Philadelphia and Detroit) have had some great years for attendance and some not so great years. Smaller boxes (such as Boston) say that a team has been very consistent in its attendance numbers. We have also filtered the chart for pre-pandemic years only, because 2021—and, to a lesser extent, 2022—skews the data.

An alternative approach to understanding how teams rank in attendance is to create indexes of where a team’s attendance stands relative to the total MLB average—which is what we’ve done directly below. Dark blue boxes mean that a team is well above the average, while dark orange boxes mean that a team is well below the average. You can use the filters to look at whatever league, division, team(s), or year(s) you’re interested in:

Long-time Domo users may be looking at these indexes and thinking that I did some pre-calculation in a Magic ETL or a Dataset View. It’s true that doing calculations on such total levels typically require pre-calculation. But if I did that, it would be hard to allow for the year filter. So, the secret is out: With Domo’s new FIXED beast modes (currently in beta), you can do FIXED level of detail functions right in a beast mode. For the above “Index to League Avg”, this is the calculation:

You can see there are two things happening here. First, when I have the SUM FIXED by League, then it is summing across all values with the same league as the row I am on. That allows me to get that league total we need for the denominator of the index. Second, it is using FILTER ALLOW to tell Domo that filters on Year can impact the FIXED functions. There are options for FILTER ALLOW, FILTER DENY, and FILTER NONE.

Here’s one last example of how useful the FIXED with FILTER DENY can be. The bar charts below are defaulted to the New York Yankees (my boss’ favorite team). The first chart is not using FIXED, so when I filter for the Yankees, the Min, Max, and Median fields become meaningless since they get filtered to be the same as the selected team. The second chart uses FIXED and DENY on team name so that the Min, Max, and Median remain as references to the main average, which is for the Yankees.

One of the things I love—and also at times find maddening—about exploring new data is that there is always more to explore. As I worked on this post, I realized that it would be quite interesting to bring in teams’ win/loss records as well as information on stadium capacity. But then I thought: Let’s maybe save that for a future post.







[ad_2]

Source link

Tags: Amazon Business Login, Amazon Business Prime, Bank Of America Business Account, Best Business Schools, Business Attorney Near Me, Business Bank Account, Business Card Holder, Business Card Maker, Business Card Template, Business Cards Near Me, Business Casual Attire, Business Casual Shoes, Business Casual Woman, Business Plan Examples, Ca Business Search, Ca Sos Business Search, Capital One Business Credit Card, Chase Business Checking, Chase Business Credit Cards, Chase Business Customer Service, Chase Business Login, Chase Business Phone Number, Cheap Business Cards, Citizens Business Bank, Cox Business Login, Digital Business Card, Facebook Business Suite, Finance In Business, Free Business Cards, Google Business Login, Harvard Business School, Lands End Business, Massage Parlor Business Near Me, Michigan Business Entity Search, Mind Your Business, Mind Your Own Business, Ohio Business Search, Risky Business Costume, Skype For Business, Small Business Loan, Small Business Saturday 2021, Starting A Business, Texas Business Entity Search, Triumph Business Capital, Vending Machine Business, Verizon Business Customer Service, Vonage Business Login, Wells Fargo Business Account, Yahoo Small Business, Yahoo Small Business Login

Post navigation

Previous Change Healthcare sale of business unlikely to appease DOJ’s concerns on UnitedHealth
Next Seven Steps To Turn Your Business Idea Into A Reality
September 2026
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  
« Aug    

Archives

  • September 2026
  • August 2026
  • July 2026
  • May 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • January 2025
  • December 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • November 2018
  • October 2018
  • January 2017

Recent Posts

  • The Psychology of Money: How Your Mindset Shapes Your Financial Destiny
  • Unleashing the Inner Maverick: Redefining Entrepreneurship in a Disruptive World
  • Monetize Your Mind: Unconventional Online Business Ideas That Actually Work
  • The Business Analyst Blueprint: From Data to Decision-Making Dominance
  • The Future of Finances: How Smart Accounting Software is Revolutionizing Small Businesses

Categories

  • Accounting
  • Advertise
  • Business Analyst
  • Business Ideas
  • Enterpreneurship
  • Finance
  • Finance Marketing
  • General
  • Lifestyle
  • Property
  • Real Estate
  • sport

BL

Tags

Amazon Business Credit Card American Airlines Business Class Att Business Login Austin Business Journal Best Bank For Small Business Best Business Bank Accounts Best Business Schools In Us Best Business To Start British Airways Business Class Business Business Attire Men Business Card Ideas Business Casual Shoes For Women Business Continuity Planning Business Entity Search Business Letter Template Business Management Degree Business Manager Facebook Business Plan Outline Business School Rankings Colorado Business Search Delaware Business Entity Search Drop Shipping Business Family Business Bet Fox Business Live Georgia Sos Business Search Google Business Account Harvest Small Business Finance How To Build Business Credit Is Saturday A Business Day Is Sears Still In Business Microsoft 365 Business My Business Google Name Generator Business None Of Your Business Ny Sos Business Search Open A Business Bank Account Pa Business Search Plus Size Business Casual Pnc Business Banking Sos Business Search Ca Sunbiz Business Search Taking Care Of Business The Business Of Being Born Turbotax Home And Business 2020

Fiverr

Fiverr Logo

PHP 2026

ymlp210
jaimebaxley
glittertextlive.com | Magazine 7 by AF themes.

WhatsApp us