Skip to content

Commit 6b5ba68

Browse files
committed
completed task1 module1/module2
1 parent 11fa4cc commit 6b5ba68

File tree

2 files changed

+99
-92
lines changed

2 files changed

+99
-92
lines changed

Module 1/Getting Familiar with Numpy.ipynb

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 1,
20-
"metadata": {
21-
"collapsed": true
22-
},
19+
"execution_count": 6,
20+
"metadata": {},
2321
"outputs": [],
2422
"source": [
2523
"import numpy as np"
@@ -63,15 +61,26 @@
6361
},
6462
{
6563
"cell_type": "code",
66-
"execution_count": 3,
67-
"metadata": {
68-
"collapsed": true
69-
},
70-
"outputs": [],
64+
"execution_count": 11,
65+
"metadata": {},
66+
"outputs": [
67+
{
68+
"data": {
69+
"text/plain": [
70+
"matrix([[1., 0., 0.],\n",
71+
" [0., 1., 0.],\n",
72+
" [0., 0., 1.]])"
73+
]
74+
},
75+
"execution_count": 11,
76+
"metadata": {},
77+
"output_type": "execute_result"
78+
}
79+
],
7180
"source": [
7281
"# ====================== YOUR CODE HERE ======================\n",
7382
"# Instructions: Generate a 3x3 Identity matrix using numpy\n",
74-
" \n",
83+
"np.matrix(np.eye(3)) \n",
7584
" \n",
7685
" \n",
7786
" \n",
@@ -101,10 +110,8 @@
101110
},
102111
{
103112
"cell_type": "code",
104-
"execution_count": 25,
105-
"metadata": {
106-
"collapsed": true
107-
},
113+
"execution_count": 14,
114+
"metadata": {},
108115
"outputs": [],
109116
"source": [
110117
"X = np.matrix([5,5]).transpose()\n",
@@ -120,15 +127,24 @@
120127
},
121128
{
122129
"cell_type": "code",
123-
"execution_count": 30,
124-
"metadata": {
125-
"collapsed": true
126-
},
127-
"outputs": [],
130+
"execution_count": 15,
131+
"metadata": {},
132+
"outputs": [
133+
{
134+
"data": {
135+
"text/plain": [
136+
"matrix([[20]])"
137+
]
138+
},
139+
"execution_count": 15,
140+
"metadata": {},
141+
"output_type": "execute_result"
142+
}
143+
],
128144
"source": [
129145
"# ====================== YOUR CODE HERE ======================\n",
130146
"# Instructions: Multiply theta transpose by X\n",
131-
" \n",
147+
"np.dot(theta.transpose(),X) \n",
132148
" \n",
133149
" \n",
134150
" \n",
@@ -164,7 +180,7 @@
164180
"name": "python",
165181
"nbconvert_exporter": "python",
166182
"pygments_lexer": "ipython3",
167-
"version": "3.6.3"
183+
"version": "3.7.0"
168184
}
169185
},
170186
"nbformat": 4,

0 commit comments

Comments
 (0)