From e74428f7d20e05ee99d5c331610dbf43691583a0 Mon Sep 17 00:00:00 2001 From: Zoe Loh Date: Fri, 29 Sep 2017 11:22:23 -0400 Subject: [PATCH 1/3] Initial commit by Zoe --- problem1.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 problem1.py diff --git a/problem1.py b/problem1.py new file mode 100644 index 0000000..d75cb97 --- /dev/null +++ b/problem1.py @@ -0,0 +1,9 @@ +import pandas +import matplotlib.pyplot as plt + +game = pandas.read_table('UWvMSU_1-22-13.txt') + +game = game.assign(UWscore = 0) +game = game.assign(MSUscore = 0) + +print(game) From 2be470e68cc225df7a1774b954c1a0eed6a0502d Mon Sep 17 00:00:00 2001 From: Soren Holm Date: Sun, 1 Oct 2017 12:13:10 -0400 Subject: [PATCH 2/3] Problem 1 done --- problem1.py | 21 ++++++++++++++++++++- problem2.py | 0 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 problem2.py diff --git a/problem1.py b/problem1.py index d75cb97..ed4bd1f 100644 --- a/problem1.py +++ b/problem1.py @@ -6,4 +6,23 @@ game = game.assign(UWscore = 0) game = game.assign(MSUscore = 0) -print(game) + +if game.loc[0,'team'] == 'UW': + game.loc[0,'UWscore'] += game.loc[0,'score'] +if game.loc[0,'team'] == 'MSU': + game.loc[0,'MSUscore'] += game.loc[0,'score'] + +for row in range(1, len(game)): + game.loc[row,'UWscore'] = game.loc[row - 1, 'UWscore'] + game.loc[row,'MSUscore'] = game.loc[row - 1, 'MSUscore'] + + if game.loc[row,'team'] == 'UW': + game.loc[row,'UWscore'] += game.loc[row,'score'] + if game.loc[row,'team'] == 'MSU': + game.loc[row,'MSUscore'] += game.loc[row,'score'] + +plt.plot(game.time,game.UWscore,'-r',game.time,game.MSUscore,'-b') + +#print(len(game)) + +#print(game) diff --git a/problem2.py b/problem2.py new file mode 100644 index 0000000..e69de29 From dff363caa8098863cf7df9539babed9089e99e7c Mon Sep 17 00:00:00 2001 From: Zoe Loh Date: Sun, 1 Oct 2017 12:45:24 -0400 Subject: [PATCH 3/3] problem 2 done --- problem2.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/problem2.py b/problem2.py index e69de29..033b59c 100644 --- a/problem2.py +++ b/problem2.py @@ -0,0 +1,12 @@ +import numpy + +randomNumber = numpy.random.choice(numpy.arange(1,101)) +Guess = -1 +print("I'm thikning of a number 1-100...") +while Guess != randomNumber: + Guess = input("Guess: ") + if Guess > randomNumber: + print("Lower") + if Guess < randomNumber: + print("Higher") +print("Correct!") \ No newline at end of file