imsciences 0.9.5.6__tar.gz → 0.9.5.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imsciences
3
- Version: 0.9.5.6
3
+ Version: 0.9.5.7
4
4
  Summary: IMS Data Processing Package
5
5
  Author: IMS
6
6
  Author-email: cam@im-sciences.com
@@ -303,10 +303,11 @@ class geoprocessing:
303
303
  # 1. Read and validate data
304
304
  # -----------------------
305
305
  raw_df = read_file(raw_data)
306
- spend_df = read_file(spend_data)
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', 'city'}
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: "Test Group" for city in test_group}
362
- assignment_map.update({city: "Control Group" for city in control_group})
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
  # -----------------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imsciences
3
- Version: 0.9.5.6
3
+ Version: 0.9.5.7
4
4
  Summary: IMS Data Processing Package
5
5
  Author: IMS
6
6
  Author-email: cam@im-sciences.com
@@ -8,7 +8,7 @@ def read_md(file_name):
8
8
  return f.read()
9
9
  return ''
10
10
 
11
- VERSION = '0.9.5.6'
11
+ VERSION = '0.9.5.7'
12
12
  DESCRIPTION = 'IMS Data Processing Package'
13
13
  LONG_DESCRIPTION = read_md('README.md')
14
14
 
File without changes
File without changes
File without changes