Skip to content
Open
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions Ex6_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cd Desktop/Intro_Biocom_ND_319_Tutorial6

import pandas as pd
import numpy as np

score=pd.read_table("UWvMSU_1-22-13.txt")
A=np.zeros((len(score),3))
B=pd.DataFrame(A, columns=['time','UW_score','MSU_score'])
B.time=score.time

temp_UW=0
temp_MSU=0

for i in range(0,len(score),1):
if score.team[i] == "UW":
temp_UW += score.score[i]
B.UW_score[i] = temp_UW
B.MSU_score[i] = temp_MSU
else:
temp_MSU += score.score[i]
B.MSU_score[i] = temp_MSU
B.UW_score[i] = temp_UW

import matplotlib.pyplot as plt
score_plot=plt.step(B.time, B.UW_score, 'r-', B.time, B.MSU_score, 'g-')
plt.suptitle("UW vs MSU -- Jan 22, 2013")
plt.xlabel("time")
plt.ylabel("cumulative score")
plt.savefig("UWvMSU_score.png")

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

29 changes: 29 additions & 0 deletions Ex6_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import numpy as np
numbers=np.arange(100)+1
answer=np.random.choice(numbers)
guess=0
name= raw_input ("What is your name?")
print("Wanna play a game %s?") %(name)
print("Guess a number 1-100")
while guess!= answer:
guess = input ("Your guess is:")
if guess > 0:
if guess > answer:
print "Lower"
else:
print "Higher"
else:
break
else:
print ("Congrats %s, you win....this time") %(name)


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










Binary file added UWvMSU_score.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.