myawesomepkg 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,319 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 10,
6
+ "id": "b1716d12-c5e2-43e6-a9b2-23fdab9b64d6",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import numpy as np"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 11,
16
+ "id": "ff55f097-4d1c-4289-98dd-c65faad54cd0",
17
+ "metadata": {},
18
+ "outputs": [
19
+ {
20
+ "data": {
21
+ "text/plain": [
22
+ "52.74561706217718"
23
+ ]
24
+ },
25
+ "execution_count": 11,
26
+ "metadata": {},
27
+ "output_type": "execute_result"
28
+ }
29
+ ],
30
+ "source": [
31
+ "L = np.random.random(100)\n",
32
+ "sum(L)"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "code",
37
+ "execution_count": 12,
38
+ "id": "39f25dea-4547-48e5-b46a-4fbe67945454",
39
+ "metadata": {},
40
+ "outputs": [
41
+ {
42
+ "data": {
43
+ "text/plain": [
44
+ "52.74561706217718"
45
+ ]
46
+ },
47
+ "execution_count": 12,
48
+ "metadata": {},
49
+ "output_type": "execute_result"
50
+ }
51
+ ],
52
+ "source": [
53
+ "np.sum(L)"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 13,
59
+ "id": "7da5f038-28ee-4a98-a702-042c8d0b5e1a",
60
+ "metadata": {},
61
+ "outputs": [
62
+ {
63
+ "name": "stdout",
64
+ "output_type": "stream",
65
+ "text": [
66
+ "112 ms ± 31.8 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
67
+ "1.08 ms ± 49 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)\n"
68
+ ]
69
+ }
70
+ ],
71
+ "source": [
72
+ "big_array = np.random.rand(1000000)\n",
73
+ "%timeit sum(big_array)\n",
74
+ "%timeit np.sum(big_array)"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "execution_count": 15,
80
+ "id": "6d945538-3f7a-48f7-8308-ddc0118ef92e",
81
+ "metadata": {},
82
+ "outputs": [
83
+ {
84
+ "data": {
85
+ "text/plain": [
86
+ "(2.459947670896412e-06, 0.9999994968740656)"
87
+ ]
88
+ },
89
+ "execution_count": 15,
90
+ "metadata": {},
91
+ "output_type": "execute_result"
92
+ }
93
+ ],
94
+ "source": [
95
+ "min(big_array), max(big_array)"
96
+ ]
97
+ },
98
+ {
99
+ "cell_type": "code",
100
+ "execution_count": 16,
101
+ "id": "6340e901-30d7-4a36-9421-ba0f87e64969",
102
+ "metadata": {},
103
+ "outputs": [
104
+ {
105
+ "data": {
106
+ "text/plain": [
107
+ "(2.459947670896412e-06, 0.9999994968740656)"
108
+ ]
109
+ },
110
+ "execution_count": 16,
111
+ "metadata": {},
112
+ "output_type": "execute_result"
113
+ }
114
+ ],
115
+ "source": [
116
+ "np.min(big_array), np.max(big_array)"
117
+ ]
118
+ },
119
+ {
120
+ "cell_type": "code",
121
+ "execution_count": 17,
122
+ "id": "2c837204-ddd6-4206-99d3-e2dc356f92ba",
123
+ "metadata": {},
124
+ "outputs": [
125
+ {
126
+ "name": "stdout",
127
+ "output_type": "stream",
128
+ "text": [
129
+ "[[0.40515773 0.12656963 0.14937442 0.00683728]\n",
130
+ " [0.3502941 0.62659932 0.54795217 0.13145624]\n",
131
+ " [0.05532995 0.49480523 0.77369714 0.42759192]]\n"
132
+ ]
133
+ }
134
+ ],
135
+ "source": [
136
+ " M = np.random.random((3, 4))\n",
137
+ " print(M)"
138
+ ]
139
+ },
140
+ {
141
+ "cell_type": "code",
142
+ "execution_count": 18,
143
+ "id": "973947a3-609a-4883-abe8-c2f044c9b78a",
144
+ "metadata": {},
145
+ "outputs": [
146
+ {
147
+ "data": {
148
+ "text/plain": [
149
+ "4.095665116718065"
150
+ ]
151
+ },
152
+ "execution_count": 18,
153
+ "metadata": {},
154
+ "output_type": "execute_result"
155
+ }
156
+ ],
157
+ "source": [
158
+ "M.sum()"
159
+ ]
160
+ },
161
+ {
162
+ "cell_type": "code",
163
+ "execution_count": 19,
164
+ "id": "87d935f2-b8f9-46f5-bea8-8bab6a4efeef",
165
+ "metadata": {},
166
+ "outputs": [
167
+ {
168
+ "data": {
169
+ "text/plain": [
170
+ "array([0.05532995, 0.12656963, 0.14937442, 0.00683728])"
171
+ ]
172
+ },
173
+ "execution_count": 19,
174
+ "metadata": {},
175
+ "output_type": "execute_result"
176
+ }
177
+ ],
178
+ "source": [
179
+ "M.min(axis=0)"
180
+ ]
181
+ },
182
+ {
183
+ "cell_type": "code",
184
+ "execution_count": 21,
185
+ "id": "65bb11eb-5b50-497b-bd83-bd4a2a81e00e",
186
+ "metadata": {},
187
+ "outputs": [
188
+ {
189
+ "data": {
190
+ "text/plain": [
191
+ "array([0.40515773, 0.62659932, 0.77369714])"
192
+ ]
193
+ },
194
+ "execution_count": 21,
195
+ "metadata": {},
196
+ "output_type": "execute_result"
197
+ }
198
+ ],
199
+ "source": [
200
+ "M.max(axis=1)"
201
+ ]
202
+ },
203
+ {
204
+ "cell_type": "code",
205
+ "execution_count": 30,
206
+ "id": "ea408e7d-6c3a-4071-a7ef-aaa51e67bfe5",
207
+ "metadata": {},
208
+ "outputs": [
209
+ {
210
+ "name": "stdout",
211
+ "output_type": "stream",
212
+ "text": [
213
+ "[189 170 189 163 183 171 185 168 173 183 173 173 175 178 183 193 178 173\n",
214
+ " 174 183 183 168 170 178 182 180 183 178 182 188 175 179 183 193 182 183\n",
215
+ " 177 185 188 188 182 185]\n"
216
+ ]
217
+ }
218
+ ],
219
+ "source": [
220
+ "import pandas as pd\n",
221
+ "data = pd.read_csv(\"D:\\\\Data\\\\president_heights.csv\")\n",
222
+ "heights = np.array(data['height(cm)'])\n",
223
+ "print(heights)"
224
+ ]
225
+ },
226
+ {
227
+ "cell_type": "code",
228
+ "execution_count": 31,
229
+ "id": "74c0b07a-e2dd-4697-89e3-0c307106dd32",
230
+ "metadata": {},
231
+ "outputs": [
232
+ {
233
+ "name": "stdout",
234
+ "output_type": "stream",
235
+ "text": [
236
+ "Mean height: 179.73809523809524\n",
237
+ "Standard deviation: 6.931843442745892\n",
238
+ "Minimum height: 163\n",
239
+ "Maximum height: 193\n"
240
+ ]
241
+ }
242
+ ],
243
+ "source": [
244
+ " print(\"Mean height: \", heights.mean())\n",
245
+ " print(\"Standard deviation:\", heights.std())\n",
246
+ " print(\"Minimum height: \", heights.min())\n",
247
+ " print(\"Maximum height: \", heights.max())"
248
+ ]
249
+ },
250
+ {
251
+ "cell_type": "code",
252
+ "execution_count": 42,
253
+ "id": "48d75be2-f202-4b67-8f70-ec2c0b2b4139",
254
+ "metadata": {},
255
+ "outputs": [
256
+ {
257
+ "name": "stdout",
258
+ "output_type": "stream",
259
+ "text": [
260
+ "25th percentile: 174.25\n",
261
+ "Median: 182.0\n",
262
+ "75th percentile: 183.0\n"
263
+ ]
264
+ }
265
+ ],
266
+ "source": [
267
+ "print(\"25th percentile: \", np.percentile(heights, 25))\n",
268
+ "print(\"Median: \", np.median(heights))\n",
269
+ "print(\"75th percentile: \", np.percentile(heights, 75))"
270
+ ]
271
+ },
272
+ {
273
+ "cell_type": "code",
274
+ "execution_count": 43,
275
+ "id": "f9b51dce-4595-4bc2-8bd0-0aba2df203d4",
276
+ "metadata": {},
277
+ "outputs": [],
278
+ "source": [
279
+ "%matplotlib inline\n",
280
+ "import matplotlib.pyplot as plt\n",
281
+ "import seaborn; seaborn.set() # set plot style"
282
+ ]
283
+ },
284
+ {
285
+ "cell_type": "code",
286
+ "execution_count": null,
287
+ "id": "fb31754c-62a9-4887-8552-8b7940135557",
288
+ "metadata": {},
289
+ "outputs": [],
290
+ "source": [
291
+ "plt.hist(heights)\n",
292
+ "plt.title('Height Distribution of US Presidents')\n",
293
+ " plt.xlabel('height (cm)')\n",
294
+ " plt.ylabel('number');\n"
295
+ ]
296
+ }
297
+ ],
298
+ "metadata": {
299
+ "kernelspec": {
300
+ "display_name": "Python 3 (ipykernel)",
301
+ "language": "python",
302
+ "name": "python3"
303
+ },
304
+ "language_info": {
305
+ "codemirror_mode": {
306
+ "name": "ipython",
307
+ "version": 3
308
+ },
309
+ "file_extension": ".py",
310
+ "mimetype": "text/x-python",
311
+ "name": "python",
312
+ "nbconvert_exporter": "python",
313
+ "pygments_lexer": "ipython3",
314
+ "version": "3.11.7"
315
+ }
316
+ },
317
+ "nbformat": 4,
318
+ "nbformat_minor": 5
319
+ }