None of this is being used. Most of it was abandoned. Just some brainstorming on how to approach presenting the data and what metrics to use.
Change csv file to have a column label for the various obstacles and points so it can be indexed into easier. Chagne index_col to corrospond. Finish graphs.
In [1]:
def test():
print "testing to see if migrated repository works"
In [2]:
def dash():
print "-" * 20
In [3]:
# import libraries
import pandas as pd
import matplotlib.pyplot as plot
import matplotlib
matplotlib.style.use('ggplot')
import random as rng
import numpy as np
%matplotlib inline
# take a url of the csv or can read the csv locally into a pandas data frame
data = pd.read_csv("robodummy.csv", index_col=0)
9 defenses
Data structure choices include:
In [4]:
# Object oriented approach, would have to feed csv data into objects
# maybe get rid of this and just use library analysis tools
class Robot(object):
def __init__(self, name, alliance, auto_points, points):
self.name = name
self.alliance = alliance
self.auto_points = auto_points
self.points = points
def points_per_sec(self):
return self.points / 150
def auto_points_per_sec(self):
return self.auto_points / 15
def get_name(self):
return self.name
def get_alliance(self):
return self.alliance
In [10]:
data
Out[10]:
In [5]:
# needs to be changed to align with new csv formatting
def analyze(dataframe, team):
total_points = dataframe[team]['Points'] + dataframe[team]['Auto Points']
cumulative_success_rate = 4
pps = dataframe[team]['Points'] / 150
auto_pps = dataframe[team]['Auto Points'] / 15
# return a data frame instead
return(total_points, pps, auto_pps)
stuff = analyze(data, 'Cougar Tech')
print stuff
Analysis Functions:
In [12]:
data.plot.bar()
Out[12]:
In [ ]:
print data.shape[0]
data[1][1]
In [ ]:
n_groups = data.shape[0]
fig, ax = plot.subplots()
index = np.arange(n_groups)
bar_width = 0.35
opacity = 0.4
error_config = {'ecolor': '0.3'}
rects1 = plot.bar(index, data["Cougar Tech"], bar_width,
alpha=opacity,
color='b',
error_kw=error_config,
label='Men')
plot.xlabel('Group')
plot.ylabel('Scores')
plot.title('Scores by group and gender')
plot.xticks(index + bar_width, data[])
plot.legend()
plot.tight_layout()
plot.show()