imsciences 0.9.5.6__py3-none-any.whl → 0.9.5.7__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.
Potentially problematic release.
This version of imsciences might be problematic. Click here for more details.
- imsciences/geo.py +6 -9
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/METADATA +1 -1
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/RECORD +7 -7
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/LICENSE.txt +0 -0
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/PKG-INFO-IMS-24Ltp-3 +0 -0
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/WHEEL +0 -0
- {imsciences-0.9.5.6.dist-info → imsciences-0.9.5.7.dist-info}/top_level.txt +0 -0
imsciences/geo.py
CHANGED
|
@@ -303,10 +303,11 @@ class geoprocessing:
|
|
|
303
303
|
# 1. Read and validate data
|
|
304
304
|
# -----------------------
|
|
305
305
|
raw_df = read_file(raw_data)
|
|
306
|
-
|
|
306
|
+
raw_df = raw_df.rename(columns={'city': 'geo'})
|
|
307
|
+
spend_df = read_file(spend_data).rename(columns={'Cost': 'cost'})
|
|
307
308
|
|
|
308
309
|
# Columns we minimally need in raw_df
|
|
309
|
-
required_columns = {'date', '
|
|
310
|
+
required_columns = {'date', 'geo'}
|
|
310
311
|
# Ensure the columns to aggregate are there
|
|
311
312
|
required_columns = required_columns.union(set(columns_to_aggregate))
|
|
312
313
|
missing_in_raw = required_columns - set(raw_df.columns)
|
|
@@ -336,12 +337,8 @@ class geoprocessing:
|
|
|
336
337
|
# -----------------------
|
|
337
338
|
# 3. Prepare raw data
|
|
338
339
|
# -----------------------
|
|
339
|
-
# Rename 'city' to 'geo' for consistency
|
|
340
|
-
raw_df = raw_df.rename(columns={'city': 'geo'})
|
|
341
|
-
|
|
342
340
|
# Filter only the relevant geos
|
|
343
341
|
filtered_df = raw_df[raw_df['geo'].isin(test_group + control_group)].copy()
|
|
344
|
-
|
|
345
342
|
# -----------------------
|
|
346
343
|
# 4. Group and aggregate
|
|
347
344
|
# -----------------------
|
|
@@ -357,9 +354,9 @@ class geoprocessing:
|
|
|
357
354
|
|
|
358
355
|
# -----------------------
|
|
359
356
|
# 5. Map groups (Test vs. Control)
|
|
360
|
-
# -----------------------
|
|
361
|
-
assignment_map = {city:
|
|
362
|
-
assignment_map.update({city:
|
|
357
|
+
# -----------------------
|
|
358
|
+
assignment_map = {city: 1 for city in test_group}
|
|
359
|
+
assignment_map.update({city: 2 for city in control_group})
|
|
363
360
|
grouped_df['assignment'] = grouped_df['geo'].map(assignment_map)
|
|
364
361
|
|
|
365
362
|
# -----------------------
|
|
@@ -5,7 +5,7 @@ imsciences/__init__.py,sha256=_HuYeLbDMTdt7GpKI4r6-d7yRPZgcAQ7yOW0-ydR2Yo,117
|
|
|
5
5
|
imsciences/datafunctions-IMS-24Ltp-3.py,sha256=3Snv-0iE_03StmyjtT-riOU9f4v8TaJWLoyZLJp6l8Y,141406
|
|
6
6
|
imsciences/datafunctions.py,sha256=WZrXNLO-SYrCuFt0pAbha74psMOZPY7meWJ7yWEbRpk,169953
|
|
7
7
|
imsciences/datapull.py,sha256=TPY0LDgOkcKTBk8OekbD0Grg5x0SomAK2dZ7MuT6X1E,19000
|
|
8
|
-
imsciences/geo.py,sha256
|
|
8
|
+
imsciences/geo.py,sha256=YGs2p3cZG1YkpR1MPE_1Z4BVS6Zt5A4U_xYA4_CfYbQ,17487
|
|
9
9
|
imsciences/mmm.py,sha256=w2A90eJPvMH0Mp3jh8booKaLGm0BKFqW-H92FR4OpV8,80490
|
|
10
10
|
imsciences/pull.py,sha256=8j4k9hnQ9IuxY8W_PvO6afutPm4Pz_SJRjZfU47qxX0,81654
|
|
11
11
|
imsciences/unittesting.py,sha256=U177_Txg0Lqn49zYRu5bl9OVe_X7MkNJ6V_Zd6DHOsU,45656
|
|
@@ -14,9 +14,9 @@ imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_a
|
|
|
14
14
|
imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
15
15
|
imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
16
16
|
imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
17
|
-
imsciences-0.9.5.
|
|
18
|
-
imsciences-0.9.5.
|
|
19
|
-
imsciences-0.9.5.
|
|
20
|
-
imsciences-0.9.5.
|
|
21
|
-
imsciences-0.9.5.
|
|
22
|
-
imsciences-0.9.5.
|
|
17
|
+
imsciences-0.9.5.7.dist-info/LICENSE.txt,sha256=lVq2QwcExPX4Kl2DHeEkRrikuItcDB1Pr7yF7FQ8_z8,1108
|
|
18
|
+
imsciences-0.9.5.7.dist-info/METADATA,sha256=cr8ZQn13hLbq0YPJ8DmIlXJdhVzUvssqfyrd0ADngFc,18846
|
|
19
|
+
imsciences-0.9.5.7.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
|
|
20
|
+
imsciences-0.9.5.7.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
|
|
21
|
+
imsciences-0.9.5.7.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
|
|
22
|
+
imsciences-0.9.5.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|