Created
July 11, 2018 04:38
-
-
Save smeschke/ff6bf196f56bd4cad852a5eec466b821 to your computer and use it in GitHub Desktop.
Looking at the Juggling Edge Records Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.read_csv('/home/stephen/Desktop/records.csv') | |
#get list of jugglers | |
jugglers = [] | |
for record in df.values: | |
jugglers.append(record[1]) | |
jugglers = list(set(jugglers)) | |
#get list of comparitive pr's | |
prs = [] | |
#iterate though each juggler | |
for juggler in jugglers: | |
a_list = [] | |
b_list = [] | |
#iterate through each record | |
for record in df.values: | |
#is the record by juggler? is the record the desired trick? | |
if record[1]==juggler and record[3]==5 and record[4]=='b' and record[5]=='cas': | |
a_list.append(record[7]) | |
if record[1]==juggler and record[3]==7 and record[4]=='b' and record[5]=='cas': | |
b_list.append(record[7]) | |
#just use the best record from each juggler | |
if len(a_list)>0 and len(b_list)>0: prs.append((max(a_list), max(b_list))) | |
#plot | |
import matplotlib.pyplot as plt | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
fig.subplots_adjust(top=0.85) | |
ax.set_title('5 ball cascade PR vs 7 ball cascade PR') | |
for x,y in prs: ax.scatter(x, y, s=20, c='red', alpha=.8) | |
ax.set_xlabel('5 ball cascade PR') | |
ax.set_ylabel('7 ball cascade PR') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment