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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vagrant
.ipynb_checkpoints
-*
*~
*~
*.pyc
66 changes: 58 additions & 8 deletions notebooks/week-1/week 1 - VM test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,63 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hello world\n"
]
}
],
"source": [
"print \"hello world\""
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using Theano backend.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"keras successfully imported\n",
"theano successfully imported\n",
"tensorflow successfully imported\n",
"sklearn successfully imported\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vagrant/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\n",
" warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"seaborn successfully imported\n"
]
}
],
"source": [
"import keras\n",
"print \"keras successfully imported\"\n",
Expand All @@ -42,13 +83,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"collapsed": false
"collapsed": false,
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"uni: sw3036\n"
]
}
],
"source": [
"print \"uni:\", \"fill in your uni here\""
"print \"uni:\", \"sw3036\""
]
}
],
Expand Down
14 changes: 11 additions & 3 deletions notebooks/week-2/01 - Introduction to Python - Variables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,19 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello World\n"
]
}
],
"source": [
"print \"Hello World\""
]
Expand Down Expand Up @@ -591,7 +599,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
Expand Down
17 changes: 14 additions & 3 deletions notebooks/week-2/04 - Lab 2 Assignment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"collapsed": true
},
Expand Down Expand Up @@ -60,12 +60,15 @@
" \n",
" # create here two local variables to store a unique ID for each player and the player's current 'pot' of money\n",
" # [FILL IN YOUR VARIABLES HERE]\n",
" js=0\n",
" pot=0\n",
" \n",
" # in the __init__() function, use the two input variables to initialize the ID and starting pot of each player\n",
" \n",
" def __init__(self, inputID, startingPot):\n",
" # [CREATE YOUR INITIALIZATIONS HERE]\n",
" \n",
" self.js=inputID\n",
" self.pot=startingPot\n",
" # create a function for playing the game. This function starts by taking an input for the dealer's card\n",
" # and picking a random number from the 'cards' list for the player's card\n",
"\n",
Expand All @@ -79,16 +82,22 @@
" # the 'pot' variable tracks the player's money\n",
" \n",
" if playerCard < dealerCard:\n",
" self.pot=self.pot-gameStake\n",
" print 'player '+str(self.js)+' lose,'+str(playerCard)+' vs '+str(dealerCard)\n",
" # [INCREMENT THE PLAYER'S POT, AND RETURN A MESSAGE]\n",
" else:\n",
" self.pot=self.pot+gameStake\n",
" print 'player '+str(self.js)+' win,'+str(playerCard)+' vs '+str(dealerCard)\n",
" # [INCREMENT THE PLAYER'S POT, AND RETURN A MESSAGE]\n",
" \n",
" # create an accessor function to return the current value of the player's pot\n",
" def returnPot(self):\n",
" return self.pot\n",
" # [FILL IN THE RETURN STATEMENT]\n",
" \n",
" # create an accessor function to return the player's ID\n",
" def returnID(self):\n",
" return self.js\n",
" # [FILL IN THE RETURN STATEMENT]"
]
},
Expand All @@ -111,6 +120,7 @@
" \n",
" for player in players:\n",
" dealerCard = random.choice(cards)\n",
" player.play(dealerCard)\n",
" #[EXECUTE THE PLAY() FUNCTION FOR EACH PLAYER USING THE DEALER CARD, AND PRINT OUT THE RESULTS]"
]
},
Expand All @@ -132,6 +142,7 @@
"def checkBalances(players):\n",
" \n",
" for player in players:\n",
" print 'player '+str(player.returnID())+ ' has $ '+str(player.returnPot())+ ' left'\n",
" #[PRINT OUT EACH PLAYER'S BALANCE BY USING EACH PLAYER'S ACCESSOR FUNCTIONS]"
]
},
Expand Down Expand Up @@ -307,7 +318,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python [default]",
"language": "python",
"name": "python2"
},
Expand Down
Loading