In [3]:
import matplotlib
import matplotlib.pyplot as plot
import pandas as pd
import numpy as np
%matplotlib inline
Quick test to demonstrate how the arguments in the scatterplots work and what their types are:
In [16]:
a = [3, 4, 5, 6, 7, 15]
b = [4, 5, 6, 7 , 7, 3]
size = [2, 200, 10, 2, 15]
hues = [0.1, 0.2, 0.6, 0.7, 0.9]
plot.scatter(a, b, s=size, alpha=0.5)
plot.show()
In [21]:
team_data = pd.read_csv("fake_features.csv")
team_data
Out[21]:
In [127]:
ranks = team_data['Rank']
OPR = team_data['NormalOPR']
obstacles = 5 * team_data['Obstacles']
test_hues = ['red', 'red', 'red', 'blue', 'red', 'green', 'red', 'yellow', 'red']
plot.scatter(ranks, OPR, s=obstacles, c=hues)
plot.show()
In [88]:
obstacle_list = list(obstacles)
print obstacle_list
In [126]:
top_mean = sum(obstacle_list[0:3]) / len(obstacle_list[0:3])
hues = []
for index, obstacle in enumerate(obstacle_list):
if obstacle < top_mean or index <= 3:
hues.append('blue')
elif obstacle >= top_mean:
hues.append('red')
Out[126]:
In [120]:
# testerino = []
# for i, v in enumerate(obstacle_list):
# if v < top_mean or i <= 3:
# testerino.append('blue')
# elif v >= top_mean:
# testerino.append('red')
In [121]:
testerino
Out[121]:
In [97]:
top_mean
Out[97]:
In [96]:
obstacle_list
Out[96]: