imsciences 0.6.2.7__py3-none-any.whl → 0.6.2.9__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.
@@ -232,10 +232,10 @@ class dataprocessing:
232
232
  print(" - Usage: week_commencing_2_week_commencing_conversion(df,date_col,week_commencing='sun')")
233
233
  print(" - Example: week_commencing_2_week_commencing_conversion(df,'obs,week_commencing='mon')")
234
234
 
235
- print("\n42. week_commencing_2_week_commencing_conversion")
236
- print(" - Description: Take a week commencing column say sunday and creates a new column with a different week commencing e.g. monday")
237
- print(" - Usage: week_commencing_2_week_commencing_conversion(df,date_col,week_commencing='sun')")
238
- print(" - Example: week_commencing_2_week_commencing_conversion(df,'obs,week_commencing='mon')")
235
+ print("\n42. plot_chart")
236
+ print(" - Description: Plots a range of charts including line, area, scatter, bubble, bar etc.")
237
+ print(" - Usage: plot_chart(df, date_col, value_cols, chart_type='line', title='Chart', x_title='Date', y_title='Values', **kwargs)")
238
+ print(" - Example: plot_chart(df, 'obs', df.cols, chart_type='line', title='Spend Over Time', x_title='Date', y_title='Spend')")
239
239
 
240
240
 
241
241
 
@@ -763,8 +763,8 @@ class dataprocessing:
763
763
  pandas.DataFrame: DataFrame with a new column containing the look up table results.
764
764
  """
765
765
 
766
- # Create regex pattern from the dictionary keys
767
- regex_pattern = "|".join(re.escape(key) for key in to_find_dict.keys())
766
+ # Create regex pattern with word boundaries from the dictionary
767
+ regex_pattern = "|".join(r'\b' + re.escape(key) + r'\b' for key in to_find_dict.keys())
768
768
 
769
769
  # Preprocess DataFrame if multiple columns
770
770
  if len(col_names) > 1:
@@ -1498,7 +1498,7 @@ class dataprocessing:
1498
1498
  df[new_col_name] = df[column_name].apply(categorize_text)
1499
1499
  return df
1500
1500
 
1501
- def compare_overlap(df1, df2, date_col):
1501
+ def compare_overlap(self,df1, df2, date_col):
1502
1502
  """
1503
1503
  Compare overlapping periods between two DataFrames and provide a summary of total differences.
1504
1504
 
@@ -1554,7 +1554,7 @@ class dataprocessing:
1554
1554
  return diff_df, total_diff_df
1555
1555
 
1556
1556
  # Convert week commencing col (should be most likely monday to sunday or vice versa)
1557
- def week_commencing_2_week_commencing_conversion(df,date_col,week_commencing='sun'):
1557
+ def week_commencing_2_week_commencing_conversion(self,df,date_col,week_commencing='sun'):
1558
1558
  """
1559
1559
  Convert week commencing column in a DataFrame to the start of another day specified.
1560
1560
 
@@ -1572,7 +1572,7 @@ class dataprocessing:
1572
1572
 
1573
1573
  return df
1574
1574
 
1575
- def plot_chart(df, date_col, value_cols, chart_type='line', title='Chart', x_title='Date', y_title='Values', **kwargs):
1575
+ def plot_chart(self, df, date_col, value_cols, chart_type='line', title='Chart', x_title='Date', y_title='Values', **kwargs):
1576
1576
  """
1577
1577
  Plot various types of charts using Plotly.
1578
1578
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imsciences
3
- Version: 0.6.2.7
3
+ Version: 0.6.2.9
4
4
  Summary: IMS Data Processing Package
5
5
  Author: IMS
6
6
  Author-email: cam@im-sciences.com
@@ -3,14 +3,14 @@ dataprocessing/data-processing-functions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nF
3
3
  dataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
4
4
  imsciences/__init__.py,sha256=GIPbLmWc06sVcOySWwNvMNUr6XGOHqPLryFIWgtpHh8,78
5
5
  imsciences/datafunctions-IMS-24Ltp-3.py,sha256=3Snv-0iE_03StmyjtT-riOU9f4v8TaJWLoyZLJp6l8Y,141406
6
- imsciences/datafunctions.py,sha256=PGuvgJIurXGWM8E1M_w9BijUJGBm5FTaZVE-C1_sPog,151382
6
+ imsciences/datafunctions.py,sha256=U7P6CbsYj-dNol25XE4CH5TIwmngHq8A61h-xghIZMA,151424
7
7
  imsciences/datapull.py,sha256=TPY0LDgOkcKTBk8OekbD0Grg5x0SomAK2dZ7MuT6X1E,19000
8
8
  imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
9
9
  imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
10
10
  imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
11
11
  imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
12
- imsciences-0.6.2.7.dist-info/METADATA,sha256=0IT7pWYxsHXerkqBVKsS2Zh1_6qwn1u7NL3mK44c4tk,854
13
- imsciences-0.6.2.7.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
14
- imsciences-0.6.2.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
15
- imsciences-0.6.2.7.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
16
- imsciences-0.6.2.7.dist-info/RECORD,,
12
+ imsciences-0.6.2.9.dist-info/METADATA,sha256=Z19p_LKB8Vv7TBot2-9K_KdVrQ9TT78eBdrmE5_0KI8,854
13
+ imsciences-0.6.2.9.dist-info/PKG-INFO-IMS-24Ltp-3,sha256=yqZbigwHjnYoqyI81PGz_AeofRFfOrwH_Vyawyef-mg,854
14
+ imsciences-0.6.2.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
15
+ imsciences-0.6.2.9.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
16
+ imsciences-0.6.2.9.dist-info/RECORD,,