Analyzing Power Lifting Data

https://clipartstation.com/bench-press-clipart/
  • Looking at how much lifters lift in terms of bench press, squats and, dead-lifts per gender.
  • See which competitions these countries are located that have the most disqualified lifters via a geo-scatter plot.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import pycountry
import plotly.express as px
import zipfile
# load dataset# get the zip file of the data and then extract it using zf.open()
zf = zipfile.ZipFile('openpowerlifting-latest.zip')
powerlifting = pd.read_csv(zf.open("openpowerlifting-2020-06-20/openpowerlifting-2020-06-20.csv"), low_memory=False)
powerlifting.columns
Index(['Name', 'Sex', 'Event', 'Equipment', 'Age', 'AgeClass',
'BirthYearClass', 'Division', 'BodyweightKg', 'WeightClassKg',
'Squat1Kg', 'Squat2Kg', 'Squat3Kg', 'Squat4Kg', 'Best3SquatKg',
'Bench1Kg', 'Bench2Kg', 'Bench3Kg', 'Bench4Kg', 'Best3BenchKg',
'Deadlift1Kg', 'Deadlift2Kg', 'Deadlift3Kg', 'Deadlift4Kg',
'Best3DeadliftKg', 'TotalKg', 'Place', 'Dots', 'Wilks', 'Glossbrenner',
'Goodlift', 'Tested', 'Country', 'Federation', 'ParentFederation',
'Date', 'MeetCountry', 'MeetState', 'MeetTown', 'MeetName'],
dtype='object')
powerlifting.shape # got close to 2 million powerlifting records# How many Men, Women and Mixed genders participate
gender_plot = sb.countplot(x="Sex", data=powerlifting)
gender_plot.set_title("Gender")

Visualizing Lift Attempts Between Male and Females

# From what wee see here, there are much more Men that compete than woman in powerlifting meets.
# Mx is for mixed gender and there seems to be much less; 16 lifters to be exact.
mixed_gender = powerlifting[powerlifting["Sex"] == "Mx"]
len(mixed_gender)
# filter out the Mixed genders and create some histogram plots of how much lifters squat, bench and, deadlift
# and ranking scores
not_mixed_gender = powerlifting[powerlifting["Sex"] != "Mx"]
# histogram of gender vs each of the 3 Bench press attempts
g1 = sb.FacetGrid(not_mixed_gender, col="Sex")
g1.map(plt.hist, "Bench1Kg")
g2 = sb.FacetGrid(not_mixed_gender, col="Sex")
g2.map(plt.hist, "Bench2Kg")
g3 = sb.FacetGrid(not_mixed_gender, col="Sex")
g3.map(plt.hist, "Bench3Kg")
# 3 attempts of squats for each gender
g4 = sb.FacetGrid(not_mixed_gender, col="Sex")
g4.map(plt.hist, "Squat1Kg")
g5 = sb.FacetGrid(not_mixed_gender, col="Sex")
g5.map(plt.hist, "Squat2Kg")
g6 = sb.FacetGrid(not_mixed_gender, col="Sex")
g6.map(plt.hist, "Squat3Kg")
g7 = sb.FacetGrid(not_mixed_gender, col="Sex")
g7.map(plt.hist, "Deadlift1Kg")
g8 = sb.FacetGrid(not_mixed_gender, col="Sex")
g8.map(plt.hist, "Deadlift2Kg")
g9 = sb.FacetGrid(not_mixed_gender, col="Sex")
g9.map(plt.hist, "Deadlift3Kg")

Where In the World are Lifters Being Disqualified at?

  • Filter the data to only have lifters who were disqualified.
  • Calculate the number of lifters disqualified per meet country.
  • Add a ISO alpha 3 code to the data for the purpose of creating the scatter geo plot. To know more about ISO alpha 3 country codes, click here.
  • Use the programming python’s plotly package to create the plot.
This page uses data from the OpenPowerlifting project, https://www.openpowerlifting.org.
You may download a copy of the data at
https://gitlab.com/openpowerlifting/opl-data

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jonathan Hernandez

Jonathan Hernandez

Data science grad who loves blogging about data science topics. Open to work.