-
Notifications
You must be signed in to change notification settings - Fork 10
Bruzzese Inskeep Nemera Submission for exercise 6 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bruzecruise
wants to merge
24
commits into
lyy005:master
Choose a base branch
from
bruzecruise:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a325e7d
exercise6 file created
d1dabf0
data frame loaded!
453ca36
data frame loaded!
0afa63d
Added blank matrix
kinskeep 3007b62
blank column
0c626d9
Merge remote-tracking branch 'origin/master'
c3935c7
blank column
db3a50e
Merging with master
kinskeep eb8db9d
Merge branch 'master' of https://github.com/omegadan01/Intro_Biocom_N…
kinskeep b1e5a91
Recreating blank dataframe
kinskeep ace33da
Adding pseudocode to make cumulative sums
kinskeep d53a8eb
Merge branch 'master' of C:\Users\NicCage\PycharmProjects\exercise6\I…
3b7852a
q1: got a loop running through the dataframe
850bcd2
q1: made lists
fbf6e60
q1: work on list loop
1fb609a
q1: got the count loop working!!!!!!!!!!!! now just need to graph.
534b8a9
q1: cleaned up code
a66d229
q1: cleaned up code again- just needs to be graphed
5503e2d
q1: made a rough draft of the graph needs refining
3ea51ef
Cleaning up plot
kinskeep e69df5e
question 2
MatiNem 831bd6b
question 2 commented
MatiNem 7f1f8f1
q1: fixed the broken loop... code was delted... q1 works now!
3d47c31
everything looks great and runs!
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #### EXERCISE 6 ##### | ||
| #question 1 | ||
|
|
||
| #load the dataset | ||
| import pandas | ||
| bball = pandas.read_csv("UWvMSU_1-22-13.txt", sep='\t', lineterminator='\r') | ||
|
|
||
| #create blank column totalscore | ||
| bball2=bball.assign(totalscore="") | ||
|
|
||
| #make blank lists | ||
| uw_list = [] | ||
| msu_list = [] | ||
|
|
||
| #fill lists - one for each team | ||
| for i in range(0,len(bball2),1): | ||
| if bball2.team[i]=="UW": | ||
| uw_list.append(i) | ||
| else: | ||
| msu_list.append(i) | ||
|
|
||
| #add total score columns UW | ||
| for i in range(len(uw_list)): | ||
| if i == 0: | ||
| bball2.loc[uw_list[i], "totalscore"] = bball2.score.loc[uw_list[i]] | ||
| else: | ||
| bball2.loc[uw_list[i], "totalscore"] =bball2.totalscore.loc[uw_list[i-1]] + bball2.score.loc[uw_list[i]] | ||
|
|
||
|
|
||
| #add total score msu | ||
|
|
||
| for i in range(len(msu_list)): | ||
| if i == 0: | ||
| bball2.loc[msu_list[i], "totalscore"] = bball2.score.loc[msu_list[i]] | ||
| else: | ||
| bball2.loc[msu_list[i], "totalscore"] = bball2.totalscore.loc[msu_list[i - 1]] + bball2.score.loc[msu_list[i]] | ||
|
|
||
| print (bball2) | ||
|
|
||
| #making the plot! | ||
| from plotnine import * | ||
| p=(ggplot(data=bball2) | ||
| + aes(x= "time", y= "totalscore", group= 'team', color= 'team') | ||
| + geom_line() | ||
| + geom_point() | ||
| + xlab("Game Progress") | ||
| + ylab("Total Score") | ||
| + xlim(0,40) | ||
| +scale_color_manual(values=['green','red']) | ||
| + theme_classic() | ||
| ) | ||
| print p | ||
|
|
||
|
|
||
| #question 2 | ||
| import numpy | ||
| rand = numpy.random.randint(1, 101) #Generates a random number | ||
| while True: #Loops through three conditions | ||
| print("I'm thinking of a number 1-100...") | ||
| guess = input("Guess") #Allows user to input a "Guess" | ||
| if guess < rand: #Returns appropriate hint for comparison of rand to Guess | ||
| print("Higher") | ||
| continue | ||
| elif guess > rand: | ||
| print("Lower") | ||
| continue | ||
| elif guess == rand: | ||
| print("Correct!") | ||
| break | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job |
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job