Skip to content

Commit 2064171

Browse files
committed
Getting the notebooks modernized
(and fix a few errors)
1 parent 5de2f92 commit 2064171

5 files changed

+354
-316
lines changed

AnatomyOfMatplotlib-Part0-Intro2NumPy.ipynb

+59-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"metadata": {
3-
"name": "AnatomyOfMatplotlib-Part0-Intro2NumPy"
3+
"name": "",
4+
"signature": "sha256:90ccb5909624353434d7af8f1073a89ba8f8f43775a430cf536d07701670eb19"
45
},
56
"nbformat": 3,
67
"nbformat_minor": 0,
@@ -12,12 +13,66 @@
1213
"metadata": {},
1314
"source": [
1415
"# NumPy\n",
15-
"The NumPy package provides the \"ndarray\" object. The NumPy array is used to contain data of uniform type with an arbitrary number of dimensions. NumPy then provides basic mathematical and array methods to lay down the foundation for the entire SciPy ecosystem.\n",
16-
"\n",
16+
"The NumPy package provides the \"ndarray\" object. The NumPy array is used to contain data of uniform type with an arbitrary number of dimensions. NumPy then provides basic mathematical and array methods to lay down the foundation for the entire SciPy ecosystem. The following import statement is the generally accepted convention for NumPy."
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"collapsed": false,
22+
"input": [
23+
"import numpy as np"
24+
],
25+
"language": "python",
26+
"metadata": {},
27+
"outputs": []
28+
},
29+
{
30+
"cell_type": "markdown",
31+
"metadata": {},
32+
"source": [
1733
"## Array Creation\n",
1834
"There are several ways to make NumPy arrays. An array has three particular attributes that can be queried: shape, size and the number of dimensions."
1935
]
2036
},
37+
{
38+
"cell_type": "code",
39+
"collapsed": false,
40+
"input": [
41+
"a = np.array([1, 2, 3])\n",
42+
"print a.shape\n",
43+
"print a.size\n",
44+
"print a.ndim"
45+
],
46+
"language": "python",
47+
"metadata": {},
48+
"outputs": []
49+
},
50+
{
51+
"cell_type": "code",
52+
"collapsed": false,
53+
"input": [
54+
"x = np.arange(100)\n",
55+
"print x.shape\n",
56+
"print x.size\n",
57+
"print x.ndim"
58+
],
59+
"language": "python",
60+
"metadata": {},
61+
"outputs": []
62+
},
63+
{
64+
"cell_type": "code",
65+
"collapsed": false,
66+
"input": [
67+
"y = np.random.rand(5, 80)\n",
68+
"print y.shape\n",
69+
"print y.size\n",
70+
"print y.ndim"
71+
],
72+
"language": "python",
73+
"metadata": {},
74+
"outputs": []
75+
},
2176
{
2277
"cell_type": "markdown",
2378
"metadata": {},
@@ -202,4 +257,4 @@
202257
"metadata": {}
203258
}
204259
]
205-
}
260+
}

0 commit comments

Comments
 (0)