-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumPy Arrays 2d.ipynb.json
More file actions
76 lines (76 loc) · 1.49 KB
/
NumPy Arrays 2d.ipynb.json
File metadata and controls
76 lines (76 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[180. 78.4]\n",
" [215. 102.7]\n",
" [210. 98.5]\n",
" [188. 75.2]]\n",
"(4, 2)\n"
]
}
],
"source": [
"# Create baseball, a list of lists\n",
"baseball = [[180, 78.4],\n",
" [215, 102.7],\n",
" [210, 98.5],\n",
" [188, 75.2]]\n",
"\n",
"# Import numpy\n",
"import numpy as np\n",
"\n",
"# Create a 2D numpy array from baseball: np_baseball\n",
"np_baseball=np.array(baseball)\n",
"\n",
"# Print out the type of np_baseball\n",
"print(np_baseball)\n",
"\n",
"# Print out the shape of np_baseball\n",
"print(np_baseball.shape)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}