pytae 2.2.2__tar.gz → 2.2.4__tar.gz

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 (35) hide show
  1. pytae-2.2.4/.ipynb_checkpoints/README-checkpoint.md +20 -0
  2. {pytae-2.2.2 → pytae-2.2.4}/.ipynb_checkpoints/pyproject-checkpoint.toml +1 -1
  3. {pytae-2.2.2 → pytae-2.2.4}/PKG-INFO +12 -5
  4. pytae-2.2.4/README.md +20 -0
  5. {pytae-2.2.2 → pytae-2.2.4}/pyproject.toml +1 -1
  6. {pytae-2.2.2 → pytae-2.2.4}/src/.ipynb_checkpoints/agg_df-checkpoint.ipynb +10 -10
  7. {pytae-2.2.2 → pytae-2.2.4}/src/.ipynb_checkpoints/get_data-checkpoint.ipynb +5 -5
  8. pytae-2.2.2/src/.ipynb_checkpoints/shape-checkpoint.ipynb → pytae-2.2.4/src/.ipynb_checkpoints/other_utilities-checkpoint.ipynb +155 -46
  9. pytae-2.2.4/src/.ipynb_checkpoints/shape-checkpoint.ipynb +709 -0
  10. {pytae-2.2.2 → pytae-2.2.4}/src/agg_df.ipynb +10 -10
  11. {pytae-2.2.2 → pytae-2.2.4}/src/get_data.ipynb +5 -5
  12. pytae-2.2.2/src/shape.ipynb → pytae-2.2.4/src/other_utilities.ipynb +155 -43
  13. pytae-2.2.4/src/pytae/.ipynb_checkpoints/__init__-checkpoint.py +4 -0
  14. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/.ipynb_checkpoints/agg_df-checkpoint.py +2 -2
  15. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/.ipynb_checkpoints/get_data-checkpoint.py +7 -7
  16. pytae-2.2.2/src/pytae/extend_pandas.py → pytae-2.2.4/src/pytae/.ipynb_checkpoints/other_utilities-checkpoint.py +2 -3
  17. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/.ipynb_checkpoints/shape-checkpoint.py +14 -28
  18. pytae-2.2.4/src/pytae/__init__.py +4 -0
  19. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/agg_df.py +2 -2
  20. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/get_data.py +7 -7
  21. pytae-2.2.2/src/pytae/.ipynb_checkpoints/extend_pandas-checkpoint.py → pytae-2.2.4/src/pytae/other_utilities.py +2 -3
  22. {pytae-2.2.2 → pytae-2.2.4}/src/pytae/shape.py +14 -28
  23. pytae-2.2.4/src/shape.ipynb +709 -0
  24. pytae-2.2.2/.ipynb_checkpoints/README-checkpoint.md +0 -13
  25. pytae-2.2.2/README.md +0 -13
  26. pytae-2.2.2/src/.ipynb_checkpoints/other_examples-checkpoint.ipynb +0 -1817
  27. pytae-2.2.2/src/other_examples.ipynb +0 -1873
  28. pytae-2.2.2/src/pytae/.ipynb_checkpoints/__init__-checkpoint.py +0 -4
  29. pytae-2.2.2/src/pytae/__init__.py +0 -4
  30. {pytae-2.2.2 → pytae-2.2.4}/.github/workflows/publish-to-test-pypi.yml +0 -0
  31. {pytae-2.2.2 → pytae-2.2.4}/.gitignore +0 -0
  32. {pytae-2.2.2 → pytae-2.2.4}/.ipynb_checkpoints/LICENSE-checkpoint +0 -0
  33. {pytae-2.2.2 → pytae-2.2.4}/.ipynb_checkpoints/requirements-checkpoint.txt +0 -0
  34. {pytae-2.2.2 → pytae-2.2.4}/LICENSE +0 -0
  35. {pytae-2.2.2 → pytae-2.2.4}/requirements.txt +0 -0
@@ -0,0 +1,20 @@
1
+ # This is my day to day util
2
+
3
+
4
+
5
+ ## This contains three sets of features:-
6
+
7
+ ### 1) that does basic data aggregation
8
+ https://github.com/maddytae/pytae/blob/master/src/agg_df.ipynb
9
+
10
+ ### 2) that transforms data long to wide; wide to long etc
11
+ https://github.com/maddytae/pytae/blob/master/src/shape.ipynb
12
+
13
+ ### 3) that gets aggregated subset of a dataframe
14
+ https://github.com/maddytae/pytae/blob/master/src/get_data.ipynb
15
+
16
+ ### 4) some addditional utilities
17
+ https://github.com/maddytae/pytae/blob/master/src/other_utilities.ipynb
18
+
19
+ #### To Do: Documentation and automated Testing features
20
+
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pytae"
7
- version = "2.2.2"
7
+ version = "2.2.4"
8
8
  authors = [
9
9
  { name="Madhukar Kumar Jha", email="madhukar.k.jha@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pytae
3
- Version: 2.2.2
3
+ Version: 2.2.4
4
4
  Dynamic: Requires-Dist
5
5
  Summary: A package to enhance common day to day tasks in the life of a data scientist
6
6
  Project-URL: Homepage, https://github.com/maddytae/pytae
@@ -15,14 +15,21 @@ Description-Content-Type: text/markdown
15
15
 
16
16
  # This is my day to day util
17
17
 
18
+
19
+
18
20
  ## This contains three sets of features:-
19
21
 
20
- ### one that extends pandas capabilities
22
+ ### 1) that does basic data aggregation
23
+ https://github.com/maddytae/pytae/blob/master/src/agg_df.ipynb
24
+
25
+ ### 2) that transforms data long to wide; wide to long etc
26
+ https://github.com/maddytae/pytae/blob/master/src/shape.ipynb
21
27
 
22
- ### two that allows to process tar files and some other interesting features and
28
+ ### 3) that gets aggregated subset of a dataframe
29
+ https://github.com/maddytae/pytae/blob/master/src/get_data.ipynb
23
30
 
24
- ### three reconcilliation of two dataframes.
25
- https://github.com/maddytae/pytae/blob/master/src/recon.ipynb
31
+ ### 4) some addditional utilities
32
+ https://github.com/maddytae/pytae/blob/master/src/other_utilities.ipynb
26
33
 
27
34
  #### To Do: Documentation and automated Testing features
28
35
 
pytae-2.2.4/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # This is my day to day util
2
+
3
+
4
+
5
+ ## This contains three sets of features:-
6
+
7
+ ### 1) that does basic data aggregation
8
+ https://github.com/maddytae/pytae/blob/master/src/agg_df.ipynb
9
+
10
+ ### 2) that transforms data long to wide; wide to long etc
11
+ https://github.com/maddytae/pytae/blob/master/src/shape.ipynb
12
+
13
+ ### 3) that gets aggregated subset of a dataframe
14
+ https://github.com/maddytae/pytae/blob/master/src/get_data.ipynb
15
+
16
+ ### 4) some addditional utilities
17
+ https://github.com/maddytae/pytae/blob/master/src/other_utilities.ipynb
18
+
19
+ #### To Do: Documentation and automated Testing features
20
+
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pytae"
7
- version = "2.2.2"
7
+ version = "2.2.4"
8
8
  authors = [
9
9
  { name="Madhukar Kumar Jha", email="madhukar.k.jha@gmail.com" },
10
10
  ]
@@ -2,7 +2,7 @@
2
2
  "cells": [
3
3
  {
4
4
  "cell_type": "code",
5
- "execution_count": 22,
5
+ "execution_count": 17,
6
6
  "id": "e1e35300-a92f-47dd-b448-83861e79eedf",
7
7
  "metadata": {},
8
8
  "outputs": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  {
17
17
  "cell_type": "code",
18
- "execution_count": 19,
18
+ "execution_count": 18,
19
19
  "id": "c3f73408-8dc7-4ea5-899b-e3b23a692cd8",
20
20
  "metadata": {},
21
21
  "outputs": [],
@@ -27,7 +27,7 @@
27
27
  },
28
28
  {
29
29
  "cell_type": "code",
30
- "execution_count": 20,
30
+ "execution_count": 19,
31
31
  "id": "db20c1c7-c11f-431d-ae9c-d0c424f0d423",
32
32
  "metadata": {},
33
33
  "outputs": [
@@ -139,18 +139,18 @@
139
139
  "6 f 45 20 22.5 25 2"
140
140
  ]
141
141
  },
142
- "execution_count": 20,
142
+ "execution_count": 19,
143
143
  "metadata": {},
144
144
  "output_type": "execute_result"
145
145
  }
146
146
  ],
147
147
  "source": [
148
- "df[['id','balance']].agg_df(type=['sum','min','mean','min','max','n'])"
148
+ "df[['id','balance']].agg_df(aggfunc=['sum','min','mean','min','max','n'])"
149
149
  ]
150
150
  },
151
151
  {
152
152
  "cell_type": "code",
153
- "execution_count": 32,
153
+ "execution_count": 20,
154
154
  "id": "66cb16ac-30b8-491e-94b4-0a2065d1e29b",
155
155
  "metadata": {},
156
156
  "outputs": [
@@ -230,7 +230,7 @@
230
230
  "6 f 45"
231
231
  ]
232
232
  },
233
- "execution_count": 32,
233
+ "execution_count": 20,
234
234
  "metadata": {},
235
235
  "output_type": "execute_result"
236
236
  }
@@ -243,7 +243,7 @@
243
243
  },
244
244
  {
245
245
  "cell_type": "code",
246
- "execution_count": 23,
246
+ "execution_count": 21,
247
247
  "id": "cbf32f4b-5f41-4ea7-bfa4-9f884d714f31",
248
248
  "metadata": {},
249
249
  "outputs": [
@@ -419,13 +419,13 @@
419
419
  "9 13514.0 334575.0 "
420
420
  ]
421
421
  },
422
- "execution_count": 23,
422
+ "execution_count": 21,
423
423
  "metadata": {},
424
424
  "output_type": "execute_result"
425
425
  }
426
426
  ],
427
427
  "source": [
428
- "penguins.agg_df(type=['n','sum']) # notice n is not repeated"
428
+ "penguins.agg_df(aggfunc=['n','sum']) "
429
429
  ]
430
430
  },
431
431
  {
@@ -2,7 +2,7 @@
2
2
  "cells": [
3
3
  {
4
4
  "cell_type": "code",
5
- "execution_count": 1,
5
+ "execution_count": 9,
6
6
  "id": "0fe64a26-2fb9-4272-b389-768653879781",
7
7
  "metadata": {},
8
8
  "outputs": [],
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "cell_type": "code",
21
- "execution_count": 2,
21
+ "execution_count": 10,
22
22
  "id": "71ff2554-e610-4592-a019-c3bc2b0c536d",
23
23
  "metadata": {},
24
24
  "outputs": [
@@ -104,7 +104,7 @@
104
104
  "4 Dream NaN Adelie 2975.0 37.5"
105
105
  ]
106
106
  },
107
- "execution_count": 2,
107
+ "execution_count": 10,
108
108
  "metadata": {},
109
109
  "output_type": "execute_result"
110
110
  }
@@ -117,7 +117,7 @@
117
117
  },
118
118
  {
119
119
  "cell_type": "code",
120
- "execution_count": 5,
120
+ "execution_count": 11,
121
121
  "id": "9ed6f23b-f588-4651-9db4-3cfb56b37a9b",
122
122
  "metadata": {},
123
123
  "outputs": [
@@ -197,7 +197,7 @@
197
197
  "4 Torgersen Male Adelie 92800.0"
198
198
  ]
199
199
  },
200
- "execution_count": 5,
200
+ "execution_count": 11,
201
201
  "metadata": {},
202
202
  "output_type": "execute_result"
203
203
  }
@@ -2,8 +2,8 @@
2
2
  "cells": [
3
3
  {
4
4
  "cell_type": "code",
5
- "execution_count": 1,
6
- "id": "b6976e0e-c64e-457a-9f28-6728d6ff75cd",
5
+ "execution_count": 6,
6
+ "id": "af0e75c1-7748-44e7-974e-34112d92d813",
7
7
  "metadata": {},
8
8
  "outputs": [],
9
9
  "source": [
@@ -15,8 +15,36 @@
15
15
  },
16
16
  {
17
17
  "cell_type": "code",
18
- "execution_count": 4,
19
- "id": "ce167daa-5219-47a4-9c5c-e857f45f8457",
18
+ "execution_count": 7,
19
+ "id": "e42e01b5-4b00-4f95-acec-274deda67a3c",
20
+ "metadata": {},
21
+ "outputs": [
22
+ {
23
+ "data": {
24
+ "text/plain": [
25
+ "['bill_depth_mm',\n",
26
+ " 'bill_length_mm',\n",
27
+ " 'body_mass_g',\n",
28
+ " 'flipper_length_mm',\n",
29
+ " 'island',\n",
30
+ " 'sex',\n",
31
+ " 'species']"
32
+ ]
33
+ },
34
+ "execution_count": 7,
35
+ "metadata": {},
36
+ "output_type": "execute_result"
37
+ }
38
+ ],
39
+ "source": [
40
+ "# get a list of columns\n",
41
+ "penguins.cols()"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type": "code",
46
+ "execution_count": 8,
47
+ "id": "e7136bed-d2e1-48c5-a337-8e31fc020a98",
20
48
  "metadata": {},
21
49
  "outputs": [
22
50
  {
@@ -126,78 +154,159 @@
126
154
  "4 3450.0 Female 24 "
127
155
  ]
128
156
  },
129
- "execution_count": 4,
157
+ "execution_count": 8,
130
158
  "metadata": {},
131
159
  "output_type": "execute_result"
132
160
  }
133
161
  ],
134
162
  "source": [
135
- "\n",
136
- "\n",
137
- "\n",
163
+ "#add a group count\n",
138
164
  "df = (\n",
139
165
  " penguins\n",
140
- " # .pipe(pt.group_n,group=['species', 'island', 'sex'],dropna=False)\n",
141
166
  " .pipe(pt.group_n,dropna=False)\n",
142
- " # .pipe(pt.handle_missing) #NaN in str is replaced with . and in numeric with 0\n",
143
- " # .pipe(pt.clip)\n",
144
- "\n",
145
167
  ")\n",
146
- "#notice that penguins dataset has multiple rows for same group\n",
147
168
  "df.head()"
148
169
  ]
149
170
  },
150
171
  {
151
172
  "cell_type": "code",
152
- "execution_count": null,
153
- "id": "1f6c2d54-67d9-48b1-b25d-e405269c84ee",
154
- "metadata": {},
155
- "outputs": [],
156
- "source": [
157
- "df.long(col='features').head() #if value is not provided then default is value"
158
- ]
159
- },
160
- {
161
- "cell_type": "code",
162
- "execution_count": null,
163
- "id": "c83b26a1-fe4e-450a-95a1-292116562dff",
173
+ "execution_count": 9,
174
+ "id": "87e3dd20-d5e1-4219-8aee-e842a3d52194",
164
175
  "metadata": {},
165
- "outputs": [],
166
- "source": [
167
- "df.long(col='features',value='measure').head()"
168
- ]
169
- },
170
- {
171
- "cell_type": "code",
172
- "execution_count": null,
173
- "id": "2582f05d-ddf4-46ae-8362-34aaa5d05fe4",
174
- "metadata": {},
175
- "outputs": [],
176
+ "outputs": [
177
+ {
178
+ "data": {
179
+ "text/html": [
180
+ "<div>\n",
181
+ "<style scoped>\n",
182
+ " .dataframe tbody tr th:only-of-type {\n",
183
+ " vertical-align: middle;\n",
184
+ " }\n",
185
+ "\n",
186
+ " .dataframe tbody tr th {\n",
187
+ " vertical-align: top;\n",
188
+ " }\n",
189
+ "\n",
190
+ " .dataframe thead th {\n",
191
+ " text-align: right;\n",
192
+ " }\n",
193
+ "</style>\n",
194
+ "<table border=\"1\" class=\"dataframe\">\n",
195
+ " <thead>\n",
196
+ " <tr style=\"text-align: right;\">\n",
197
+ " <th></th>\n",
198
+ " <th>species</th>\n",
199
+ " <th>island</th>\n",
200
+ " <th>bill_length_mm</th>\n",
201
+ " <th>bill_depth_mm</th>\n",
202
+ " <th>flipper_length_mm</th>\n",
203
+ " <th>body_mass_g</th>\n",
204
+ " <th>sex</th>\n",
205
+ " </tr>\n",
206
+ " </thead>\n",
207
+ " <tbody>\n",
208
+ " <tr>\n",
209
+ " <th>0</th>\n",
210
+ " <td>Adelie</td>\n",
211
+ " <td>Torgersen</td>\n",
212
+ " <td>39.1</td>\n",
213
+ " <td>18.7</td>\n",
214
+ " <td>181.0</td>\n",
215
+ " <td>3750.0</td>\n",
216
+ " <td>Male</td>\n",
217
+ " </tr>\n",
218
+ " <tr>\n",
219
+ " <th>1</th>\n",
220
+ " <td>Adelie</td>\n",
221
+ " <td>Torgersen</td>\n",
222
+ " <td>39.5</td>\n",
223
+ " <td>17.4</td>\n",
224
+ " <td>186.0</td>\n",
225
+ " <td>3800.0</td>\n",
226
+ " <td>Female</td>\n",
227
+ " </tr>\n",
228
+ " <tr>\n",
229
+ " <th>2</th>\n",
230
+ " <td>Adelie</td>\n",
231
+ " <td>Torgersen</td>\n",
232
+ " <td>40.3</td>\n",
233
+ " <td>18.0</td>\n",
234
+ " <td>195.0</td>\n",
235
+ " <td>3250.0</td>\n",
236
+ " <td>Female</td>\n",
237
+ " </tr>\n",
238
+ " <tr>\n",
239
+ " <th>3</th>\n",
240
+ " <td>Adelie</td>\n",
241
+ " <td>Torgersen</td>\n",
242
+ " <td>0.0</td>\n",
243
+ " <td>0.0</td>\n",
244
+ " <td>0.0</td>\n",
245
+ " <td>0.0</td>\n",
246
+ " <td>.</td>\n",
247
+ " </tr>\n",
248
+ " <tr>\n",
249
+ " <th>4</th>\n",
250
+ " <td>Adelie</td>\n",
251
+ " <td>Torgersen</td>\n",
252
+ " <td>36.7</td>\n",
253
+ " <td>19.3</td>\n",
254
+ " <td>193.0</td>\n",
255
+ " <td>3450.0</td>\n",
256
+ " <td>Female</td>\n",
257
+ " </tr>\n",
258
+ " </tbody>\n",
259
+ "</table>\n",
260
+ "</div>"
261
+ ],
262
+ "text/plain": [
263
+ " species island bill_length_mm bill_depth_mm flipper_length_mm \\\n",
264
+ "0 Adelie Torgersen 39.1 18.7 181.0 \n",
265
+ "1 Adelie Torgersen 39.5 17.4 186.0 \n",
266
+ "2 Adelie Torgersen 40.3 18.0 195.0 \n",
267
+ "3 Adelie Torgersen 0.0 0.0 0.0 \n",
268
+ "4 Adelie Torgersen 36.7 19.3 193.0 \n",
269
+ "\n",
270
+ " body_mass_g sex \n",
271
+ "0 3750.0 Male \n",
272
+ "1 3800.0 Female \n",
273
+ "2 3250.0 Female \n",
274
+ "3 0.0 . \n",
275
+ "4 3450.0 Female "
276
+ ]
277
+ },
278
+ "execution_count": 9,
279
+ "metadata": {},
280
+ "output_type": "execute_result"
281
+ }
282
+ ],
176
283
  "source": [
177
- "df.long(col='features').wide(col='features').head()\n",
178
- "# you will get back original df because penguins has been aggregated in the very beginning. "
284
+ "# handle missing i.e. str missing or NaN is changed to . and numeric NaN to 0\n",
285
+ "# add a group count\n",
286
+ "df = (\n",
287
+ " penguins\n",
288
+ " .pipe(pt.handle_missing)\n",
289
+ ")\n",
290
+ "df.head()\n"
179
291
  ]
180
292
  },
181
293
  {
182
294
  "cell_type": "code",
183
- "execution_count": null,
184
- "id": "2a6e93dc-703a-4ae4-84de-6364728b6e6f",
295
+ "execution_count": 10,
296
+ "id": "b17a9574-35ff-4fe2-b40f-054a0b5e5003",
185
297
  "metadata": {},
186
298
  "outputs": [],
187
299
  "source": [
188
- "# Had it not been the case, we could not get original df back because wide uses pivot_table that would aggregate the results\n",
189
- "penguins.long(col='features').wide(col='features')"
300
+ "df.clip()"
190
301
  ]
191
302
  },
192
303
  {
193
304
  "cell_type": "code",
194
305
  "execution_count": null,
195
- "id": "37cbef19-3391-4ec0-be90-4d4d333d3987",
306
+ "id": "b39ba218-6361-47eb-91b2-c6f35b7a130e",
196
307
  "metadata": {},
197
308
  "outputs": [],
198
- "source": [
199
- "df.cols()"
200
- ]
309
+ "source": []
201
310
  }
202
311
  ],
203
312
  "metadata": {