Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Ex6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

os.getcwd()
os.chdir("Intro_Biocom_ND_319_Tutorial6/")

import pandas
import numpy

game = pandas.read_table("UWvMSU_1-22-13.txt", sep="\t")

import matplotlib.pyplot as plt

WiscScore = game.loc[game['team'] == 'UW', ['score']]
MSUscore = game.loc[game['team'] == 'MSU', ['score', 'time']]

plt.plot(WiscScore.time, WiscScore,'r-', MSUscore.time,MSUscore,'g-')

### alternatively ###

import plotnine as p9

x = p9.ggplot(game, aes(x='time', y='score', color = 'factor(team)'))
x+geom_line()

@lyy005 lyy005 Oct 12, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is asking to plot the accumulative score of two teams. You want to add up the score for each team from the beginning of the game

-0.5 points


### Q2 ###

N = numpy.random.choice(100)

guess = int(input("Guess: "))

tries = 1

while guess != N and tries < 100:
if guess < N:
print("Higher!")
elif guess > N:
print("Lower!")
guess = int(input("Guess: "))

if guess == N:
print("Correct!")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job