myawesomepkg 0.1.8__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.
Files changed (64) hide show
  1. myawesomepkg/TSAPY1/1 (A) Working with Numpy Arrays.py +1146 -0
  2. myawesomepkg/TSAPY1/1(B)Aggregation (1).py +319 -0
  3. myawesomepkg/TSAPY1/1(C) Broadcasting .py +328 -0
  4. myawesomepkg/TSAPY1/10-A_Load_stringr.py +77 -0
  5. myawesomepkg/TSAPY1/10-B_Forcats.py +70 -0
  6. myawesomepkg/TSAPY1/2(a) Comparison, Masking And Boolean Logic (1).py +497 -0
  7. myawesomepkg/TSAPY1/2(b)Fancy Indexing.py +594 -0
  8. myawesomepkg/TSAPY1/2(c) Sorting Arrays.py +528 -0
  9. myawesomepkg/TSAPY1/2(d) Structured Array.py +350 -0
  10. myawesomepkg/TSAPY1/3 (A) Handling Missing Data.py +1013 -0
  11. myawesomepkg/TSAPY1/4A_Merge_Joins.py +1209 -0
  12. myawesomepkg/TSAPY1/9A_Dplyr.py +85 -0
  13. myawesomepkg/TSAPY1/9B_Tidyr.py +71 -0
  14. myawesomepkg/TSAPY1/Aggregation_Groupin_Pivot_Filter_Vectorice_Time_Series.py +1999 -0
  15. myawesomepkg/TSAPY1/Combining_Joins.py +1209 -0
  16. myawesomepkg/TSAPY1/P4-1-different_distance_methods_(euclidean)_with_prediction,_test_score_and_confusion_matrix1.py +131 -0
  17. myawesomepkg/TSAPY1/P4-2-k_means_clustering_with_prediction,_test_score_and_confusion_matrix2.py +150 -0
  18. myawesomepkg/TSAPY1/Pract3_C.py +482 -0
  19. myawesomepkg/TSAPY1/Pract5_Data_Visualization.py +481 -0
  20. myawesomepkg/TSAPY1/Practical 6.py +860 -0
  21. myawesomepkg/TSAPY1/Practical No 1.py +148 -0
  22. myawesomepkg/TSAPY1/Practical No 2.py +115 -0
  23. myawesomepkg/TSAPY1/Practical No 3.py +168 -0
  24. myawesomepkg/TSAPY1/Practical No 4 A.py +233 -0
  25. myawesomepkg/TSAPY1/Practical No 4 B.py +137 -0
  26. myawesomepkg/TSAPY1/Practical No 5.py +52 -0
  27. myawesomepkg/TSAPY1/Practical No 6.py +29 -0
  28. myawesomepkg/TSAPY1/Practical No 7.py +67 -0
  29. myawesomepkg/TSAPY1/Practical No 8.py +108 -0
  30. myawesomepkg/TSAPY1/Print_R.py +123 -0
  31. myawesomepkg/TSAPY1/R_Graph.py +32 -0
  32. myawesomepkg/TSAPY1/Working_Ggplot.py +53 -0
  33. myawesomepkg/TSAPY1/__init__.py +0 -0
  34. myawesomepkg/TSAPY1/p1_2_pca_iris.py +141 -0
  35. myawesomepkg/TSAPY1/p2_1_find_s.py +78 -0
  36. myawesomepkg/TSAPY1/p2_bcandidate_elimination_algorithm_(1).py +85 -0
  37. myawesomepkg/TSAPY1/p3_1_least_square_regression.py +105 -0
  38. myawesomepkg/TSAPY1/p3_2_logistic_regression_algorithm.py +79 -0
  39. myawesomepkg/TSAPY1/p5_1_hierarchical_clustering.py +143 -0
  40. myawesomepkg/TSAPY1/p5_2_k_nearest_neighbour_algorithm.py +104 -0
  41. myawesomepkg/TSAPY1/p6_1_id3_algorithm_.py +199 -0
  42. myawesomepkg/TSAPY1/p7_1_ann_backpropagation_algorithm.py +116 -0
  43. myawesomepkg/TSAPY1/p7_2_bds_association_rule_mining.py +99 -0
  44. myawesomepkg/TSAPY1/p8_1_gaussian_naive_bayes_.py +97 -0
  45. myawesomepkg/TSAPY1/p8_2_naive_bayes_document_classifier.py +111 -0
  46. myawesomepkg/TSAPY1/p9_1bayesian_network.py +91 -0
  47. myawesomepkg/TSAPY1/p9_b_loess_regression.py +113 -0
  48. myawesomepkg/TSAPY1/p_1_test_and_train.py +98 -0
  49. myawesomepkg/TSAPY1/pract3A-B.py +3212 -0
  50. myawesomepkg/TSAPY1/practical_no_3.py +167 -0
  51. myawesomepkg/TSAPY1/practical_no_4.py +215 -0
  52. myawesomepkg/TSAPY1/practical_no_4b.py +78 -0
  53. myawesomepkg/TSAPY1/practical_no_5_ac_and_pca.py +39 -0
  54. myawesomepkg/TSAPY1/practical_no_6.py +37 -0
  55. myawesomepkg/TSAPY1/practical_no_7.py +69 -0
  56. myawesomepkg/TSAPY1/practical_no_8.py +79 -0
  57. myawesomepkg/TSAPY1/tsa_practical_no_1.py +287 -0
  58. myawesomepkg/TSAPY1/tsa_practical_no_2.py +121 -0
  59. myawesomepkg/__init__.py +1 -0
  60. myawesomepkg/core.py +2 -0
  61. myawesomepkg-0.1.8.dist-info/METADATA +17 -0
  62. myawesomepkg-0.1.8.dist-info/RECORD +64 -0
  63. myawesomepkg-0.1.8.dist-info/WHEEL +5 -0
  64. myawesomepkg-0.1.8.dist-info/top_level.txt +1 -0
@@ -0,0 +1,350 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 2,
6
+ "id": "a48de104",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import numpy as np"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 3,
16
+ "id": "2a44575b",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "name = ['Alice', 'Bob', 'Cathy', 'Doug']\n",
21
+ "age = [25, 45, 37, 19]\n",
22
+ "weight = [55.0, 85.5, 68.0, 61.5]"
23
+ ]
24
+ },
25
+ {
26
+ "cell_type": "code",
27
+ "execution_count": 4,
28
+ "id": "98f8f978",
29
+ "metadata": {},
30
+ "outputs": [],
31
+ "source": [
32
+ "x = np.zeros(4, dtype=int)\n"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "code",
37
+ "execution_count": 5,
38
+ "id": "62710353",
39
+ "metadata": {},
40
+ "outputs": [
41
+ {
42
+ "name": "stdout",
43
+ "output_type": "stream",
44
+ "text": [
45
+ "[('name', '<U10'), ('age', '<i4'), ('weight', '<f8')]\n"
46
+ ]
47
+ }
48
+ ],
49
+ "source": [
50
+ "# Use a compound data type for structured arrays\n",
51
+ "data = np.zeros(4, dtype={'names':('name', 'age', 'weight'), 'formats':('U10', 'i4', 'f8')})\n",
52
+ "print(data.dtype)"
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": 6,
58
+ "id": "75429517",
59
+ "metadata": {},
60
+ "outputs": [
61
+ {
62
+ "name": "stdout",
63
+ "output_type": "stream",
64
+ "text": [
65
+ "[('Alice', 25, 55. ) ('Bob', 45, 85.5) ('Cathy', 37, 68. )\n",
66
+ " ('Doug', 19, 61.5)]\n"
67
+ ]
68
+ }
69
+ ],
70
+ "source": [
71
+ "data['name'] = name\n",
72
+ "data['age'] = age\n",
73
+ "data['weight'] = weight\n",
74
+ "print(data)\n"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "execution_count": 7,
80
+ "id": "81014a71",
81
+ "metadata": {},
82
+ "outputs": [
83
+ {
84
+ "data": {
85
+ "text/plain": [
86
+ "array(['Alice', 'Bob', 'Cathy', 'Doug'], dtype='<U10')"
87
+ ]
88
+ },
89
+ "execution_count": 7,
90
+ "metadata": {},
91
+ "output_type": "execute_result"
92
+ }
93
+ ],
94
+ "source": [
95
+ "# Get all names\n",
96
+ "data['name']"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": 8,
102
+ "id": "4ab9cc78",
103
+ "metadata": {},
104
+ "outputs": [
105
+ {
106
+ "data": {
107
+ "text/plain": [
108
+ "('Alice', 25, 55.)"
109
+ ]
110
+ },
111
+ "execution_count": 8,
112
+ "metadata": {},
113
+ "output_type": "execute_result"
114
+ }
115
+ ],
116
+ "source": [
117
+ "# Get first row of data\n",
118
+ "data[0]\n"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "execution_count": 9,
124
+ "id": "97e72108",
125
+ "metadata": {},
126
+ "outputs": [
127
+ {
128
+ "data": {
129
+ "text/plain": [
130
+ "'Doug'"
131
+ ]
132
+ },
133
+ "execution_count": 9,
134
+ "metadata": {},
135
+ "output_type": "execute_result"
136
+ }
137
+ ],
138
+ "source": [
139
+ "# Get the name from the last row\n",
140
+ "data[-1]['name']"
141
+ ]
142
+ },
143
+ {
144
+ "cell_type": "code",
145
+ "execution_count": 10,
146
+ "id": "f766b733",
147
+ "metadata": {},
148
+ "outputs": [
149
+ {
150
+ "data": {
151
+ "text/plain": [
152
+ "array(['Alice', 'Doug'], dtype='<U10')"
153
+ ]
154
+ },
155
+ "execution_count": 10,
156
+ "metadata": {},
157
+ "output_type": "execute_result"
158
+ }
159
+ ],
160
+ "source": [
161
+ "# Get names where age is under 30\n",
162
+ "data[data['age'] < 30]['name']"
163
+ ]
164
+ },
165
+ {
166
+ "cell_type": "code",
167
+ "execution_count": 11,
168
+ "id": "97755d62",
169
+ "metadata": {},
170
+ "outputs": [
171
+ {
172
+ "data": {
173
+ "text/plain": [
174
+ "dtype([('name', '<U10'), ('age', '<i4'), ('weight', '<f8')])"
175
+ ]
176
+ },
177
+ "execution_count": 11,
178
+ "metadata": {},
179
+ "output_type": "execute_result"
180
+ }
181
+ ],
182
+ "source": [
183
+ "#Creating Structured Arrays\n",
184
+ "np.dtype({'names':('name', 'age', 'weight'), 'formats':('U10', 'i4', 'f8')})\n"
185
+ ]
186
+ },
187
+ {
188
+ "cell_type": "code",
189
+ "execution_count": 12,
190
+ "id": "42dc0929",
191
+ "metadata": {},
192
+ "outputs": [
193
+ {
194
+ "data": {
195
+ "text/plain": [
196
+ "dtype([('name', 'S10'), ('age', '<i4'), ('weight', '<f8')])"
197
+ ]
198
+ },
199
+ "execution_count": 12,
200
+ "metadata": {},
201
+ "output_type": "execute_result"
202
+ }
203
+ ],
204
+ "source": [
205
+ "np.dtype([('name', 'S10'), ('age', 'i4'), ('weight', 'f8')])"
206
+ ]
207
+ },
208
+ {
209
+ "cell_type": "code",
210
+ "execution_count": 13,
211
+ "id": "49dba453",
212
+ "metadata": {},
213
+ "outputs": [
214
+ {
215
+ "data": {
216
+ "text/plain": [
217
+ "dtype([('f0', 'S10'), ('f1', '<i4'), ('f2', '<f8')])"
218
+ ]
219
+ },
220
+ "execution_count": 13,
221
+ "metadata": {},
222
+ "output_type": "execute_result"
223
+ }
224
+ ],
225
+ "source": [
226
+ "np.dtype('S10,i4,f8')\n"
227
+ ]
228
+ },
229
+ {
230
+ "cell_type": "code",
231
+ "execution_count": 14,
232
+ "id": "322c3d0b",
233
+ "metadata": {},
234
+ "outputs": [
235
+ {
236
+ "name": "stdout",
237
+ "output_type": "stream",
238
+ "text": [
239
+ "(0, [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])\n",
240
+ "[[0. 0. 0.]\n",
241
+ " [0. 0. 0.]\n",
242
+ " [0. 0. 0.]]\n"
243
+ ]
244
+ }
245
+ ],
246
+ "source": [
247
+ "#More Advanced Compound Types\n",
248
+ "tp = np.dtype([('id', 'i8'), ('mat', 'f8', (3, 3))])\n",
249
+ "X = np.zeros(1, dtype=tp)\n",
250
+ "print(X[0])\n",
251
+ "print(X['mat'][0])"
252
+ ]
253
+ },
254
+ {
255
+ "cell_type": "code",
256
+ "execution_count": 15,
257
+ "id": "5f12d9cd",
258
+ "metadata": {},
259
+ "outputs": [
260
+ {
261
+ "data": {
262
+ "text/plain": [
263
+ "array([25, 45, 37, 19])"
264
+ ]
265
+ },
266
+ "execution_count": 15,
267
+ "metadata": {},
268
+ "output_type": "execute_result"
269
+ }
270
+ ],
271
+ "source": [
272
+ "#RecordArrays: Structured Arrays with a Twist\n",
273
+ "data['age']\n"
274
+ ]
275
+ },
276
+ {
277
+ "cell_type": "code",
278
+ "execution_count": 16,
279
+ "id": "0c450acf",
280
+ "metadata": {},
281
+ "outputs": [
282
+ {
283
+ "data": {
284
+ "text/plain": [
285
+ "array([25, 45, 37, 19])"
286
+ ]
287
+ },
288
+ "execution_count": 16,
289
+ "metadata": {},
290
+ "output_type": "execute_result"
291
+ }
292
+ ],
293
+ "source": [
294
+ "data_rec = data.view(np.recarray)\n",
295
+ "data_rec.age"
296
+ ]
297
+ },
298
+ {
299
+ "cell_type": "code",
300
+ "execution_count": 17,
301
+ "id": "dfb95656",
302
+ "metadata": {},
303
+ "outputs": [
304
+ {
305
+ "name": "stdout",
306
+ "output_type": "stream",
307
+ "text": [
308
+ "141 ns ± 11 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)\n",
309
+ "2.31 µs ± 130 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n",
310
+ "3.74 µs ± 171 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
311
+ ]
312
+ }
313
+ ],
314
+ "source": [
315
+ "%timeit data['age']\n",
316
+ "%timeit data_rec['age']\n",
317
+ "%timeit data_rec.age"
318
+ ]
319
+ },
320
+ {
321
+ "cell_type": "code",
322
+ "execution_count": null,
323
+ "id": "7dfe30fe",
324
+ "metadata": {},
325
+ "outputs": [],
326
+ "source": []
327
+ }
328
+ ],
329
+ "metadata": {
330
+ "kernelspec": {
331
+ "display_name": "Python 3 (ipykernel)",
332
+ "language": "python",
333
+ "name": "python3"
334
+ },
335
+ "language_info": {
336
+ "codemirror_mode": {
337
+ "name": "ipython",
338
+ "version": 3
339
+ },
340
+ "file_extension": ".py",
341
+ "mimetype": "text/x-python",
342
+ "name": "python",
343
+ "nbconvert_exporter": "python",
344
+ "pygments_lexer": "ipython3",
345
+ "version": "3.9.13"
346
+ }
347
+ },
348
+ "nbformat": 4,
349
+ "nbformat_minor": 5
350
+ }