imsciences 0.5.4.7__py3-none-any.whl → 0.9.3__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.
- imsciences/__init__.py +4 -1
- imsciences/datafunctions-IMS-24Ltp-3.py +2711 -0
- imsciences/datafunctions.py +2842 -170
- imsciences/datapull.py +374 -0
- imsciences/geo.py +195 -0
- imsciences/mmm.py +1415 -0
- imsciences/pull.py +1483 -0
- imsciences/unittesting.py +1064 -0
- imsciences/vis.py +196 -0
- imsciences-0.9.3.dist-info/LICENSE.txt +21 -0
- imsciences-0.9.3.dist-info/METADATA +330 -0
- imsciences-0.9.3.dist-info/PKG-INFO-IMS-24Ltp-3 +24 -0
- imsciences-0.9.3.dist-info/RECORD +22 -0
- {imsciences-0.5.4.7.dist-info → imsciences-0.9.3.dist-info}/WHEEL +1 -1
- imsciences-0.5.4.7.dist-info/METADATA +0 -95
- imsciences-0.5.4.7.dist-info/RECORD +0 -13
- {imsciences-0.5.4.7.dist-info → imsciences-0.9.3.dist-info}/top_level.txt +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: imsciences
|
|
3
|
-
Version: 0.5.4.7
|
|
4
|
-
Summary: IMS Data Processing Package
|
|
5
|
-
Author: IMS
|
|
6
|
-
Author-email: cam@im-sciences.com
|
|
7
|
-
Keywords: python,data processing
|
|
8
|
-
Classifier: Development Status :: 3 - Alpha
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Operating System :: Unix
|
|
12
|
-
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: pandas
|
|
16
|
-
|
|
17
|
-
# IMS Package Documentation
|
|
18
|
-
|
|
19
|
-
The IMS package is a python library for processing incoming data into a format that can be used for projects. IMS processing offers a variety of functions to manipulate and analyze data efficiently. Here are the functionalities provided by the package:
|
|
20
|
-
|
|
21
|
-
### 1. `get_wd_levels(levels)`
|
|
22
|
-
- **Description**: Get the working directory with the option of moving up parents.
|
|
23
|
-
- **Usage**: `get_wd_levels(levels)`
|
|
24
|
-
|
|
25
|
-
### 2. `remove_rows(data_frame, num_rows_to_remove)`
|
|
26
|
-
- **Description**: Removes a specified number of rows from a pandas DataFrame.
|
|
27
|
-
- **Usage**: `remove_rows(data_frame, num_rows_to_remove)`
|
|
28
|
-
|
|
29
|
-
### 3. `aggregate_daily_to_wc_long(df, date_column, group_columns, sum_columns, wc, aggregation='sum', include_totals=False)`
|
|
30
|
-
- **Description**: Aggregates daily data into weekly data, grouping and summing specified columns, starting on a specified day of the week. In the long format.
|
|
31
|
-
- **Usage**: `aggregate_daily_to_wc_long(df, date_column, group_columns, sum_columns, wc, aggregation='sum', include_totals=False)`
|
|
32
|
-
|
|
33
|
-
### 4. `convert_monthly_to_daily(df, date_column)`
|
|
34
|
-
- **Description**: Converts monthly data in a DataFrame to daily data by expanding and dividing the numeric values.
|
|
35
|
-
- **Usage**: `convert_monthly_to_daily(df, date_column)`
|
|
36
|
-
|
|
37
|
-
### 5. `plot_two(df1, col1, df2, col2, date_column, same_axis=True)`
|
|
38
|
-
- **Description**: Plots specified columns from two different DataFrames using a shared date column. Useful for comparing data.
|
|
39
|
-
- **Usage**: `plot_two(df1, col1, df2, col2, date_column, same_axis=True)`
|
|
40
|
-
|
|
41
|
-
### 6. `remove_nan_rows(df, col_to_remove_rows)`
|
|
42
|
-
- **Description**: Removes rows from a DataFrame where the specified column has NaN values.
|
|
43
|
-
- **Usage**: `remove_nan_rows(df, col_to_remove_rows)`
|
|
44
|
-
|
|
45
|
-
### 7. `filter_rows(df, col_to_filter, list_of_filters)`
|
|
46
|
-
- **Description**: Filters the DataFrame based on whether the values in a specified column are in a provided list.
|
|
47
|
-
- **Usage**: `filter_rows(df, col_to_filter, list_of_filters)`
|
|
48
|
-
|
|
49
|
-
### 8. `plot_one(df1, col1, date_column)`
|
|
50
|
-
- **Description**: Plots a specified column from a DataFrame.
|
|
51
|
-
- **Usage**: `plot_one(df1, col1, date_column)`
|
|
52
|
-
|
|
53
|
-
### 9. `week_of_year_mapping(df, week_col, start_day_str)`
|
|
54
|
-
- **Description**: Converts a week column in 'yyyy-Www' or 'yyyy-ww' format to week commencing date.
|
|
55
|
-
- **Usage**: `week_of_year_mapping(df, week_col, start_day_str)`
|
|
56
|
-
|
|
57
|
-
### 10. `exclude_rows(df, col_to_filter, list_of_filters)`
|
|
58
|
-
- **Description**: Removes rows from a DataFrame based on whether the values in a specified column are not in a provided list.
|
|
59
|
-
- **Usage**: `exclude_rows(df, col_to_filter, list_of_filters)`
|
|
60
|
-
|
|
61
|
-
### 11. `rename_cols(df, cols_to_rename)`
|
|
62
|
-
- **Description**: Renames columns in a pandas DataFrame.
|
|
63
|
-
- **Usage**: `rename_cols(df, cols_to_rename)`
|
|
64
|
-
|
|
65
|
-
### 12. `merge_new_and_old(old_df, old_col, new_df, new_col, cutoff_date, date_col_name='OBS')`
|
|
66
|
-
- **Description**: Creates a new DataFrame with two columns: one for dates and one for merged numeric values.
|
|
67
|
-
- **Usage**: `merge_new_and_old(old_df, old_col, new_df, new_col, cutoff_date, date_col_name='OBS')`
|
|
68
|
-
|
|
69
|
-
### 13. `merge_dataframes_on_date(dataframes, common_column='OBS', merge_how='outer')`
|
|
70
|
-
- **Description**: Merge a list of DataFrames on a common column.
|
|
71
|
-
- **Usage**: `merge_dataframes_on_date(dataframes, common_column='OBS', merge_how='outer')`
|
|
72
|
-
|
|
73
|
-
### 14. `merge_and_update_dfs(df1, df2, key_column)`
|
|
74
|
-
- **Description**: Merges two dataframes on a key column, updates the first dataframe's columns with the second's where available, and returns a dataframe sorted by the key column.
|
|
75
|
-
- **Usage**: `merge_and_update_dfs(df1, df2, key_column)`
|
|
76
|
-
|
|
77
|
-
### 15. `convert_us_to_uk_dates(df, date_col)`
|
|
78
|
-
- **Description**: Convert a DataFrame column with mixed date formats to datetime.
|
|
79
|
-
- **Usage**: `convert_us_to_uk_dates(df, date_col)`
|
|
80
|
-
|
|
81
|
-
### 16. `combine_sheets(all_sheets)`
|
|
82
|
-
- **Description**: Combines multiple DataFrames from a dictionary into a single DataFrame.
|
|
83
|
-
- **Usage**: `combine_sheets({'Sheet1': df1, 'Sheet2': df2})`
|
|
84
|
-
|
|
85
|
-
### 17. `dynamic_pivot(data_frame, index_col, columns, values_col, fill_value=0)`
|
|
86
|
-
- **Description**: Dynamically pivots a DataFrame based on specified columns.
|
|
87
|
-
- **Usage**: `dynamic_pivot(df, 'Date', ['Category1', 'Category2'], ['Value1'])`
|
|
88
|
-
|
|
89
|
-
### 18. `classify_within_column(df, col_name, to_find_dict, default_value = 'other')`
|
|
90
|
-
- **Description**: Allows you to map a dictionary of substrings within a column.
|
|
91
|
-
- **Usage**: `classify_within_column(df, 'campaign', {'uk_': 'uk'}, 'other')`
|
|
92
|
-
|
|
93
|
-
### 19. `aggregate_daily_to_wc_wide(df, date_column, group_columns, sum_columns, wc, aggregation='sum', include_totals=False)`
|
|
94
|
-
- **Description**: Aggregates daily data into weekly data, grouping and summing specified columns, starting on a specified day of the week. In the wide format.
|
|
95
|
-
- **Usage**: `aggregate_daily_to_wc_wide(df, date_column, group_columns, sum_columns, wc, aggregation='sum', include_totals=False)`
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
dataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
2
|
-
dataprocessing/data-processing-functions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
3
|
-
dataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
4
|
-
imsciences/__init__.py,sha256=6BCyiGvOlCLbuIE9mbXZ8r1_chcEPn4DQgJplIIh5b4,41
|
|
5
|
-
imsciences/datafunctions.py,sha256=SVUX6ZxgpNoYlVEVaSflva_aUanFU6ELUvLxibgF3_s,33170
|
|
6
|
-
imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
7
|
-
imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
8
|
-
imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
9
|
-
imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
10
|
-
imsciences-0.5.4.7.dist-info/METADATA,sha256=DkAEYNulO5CIYNRMFtLziKdS025ityPZ9h1ZnfuH_M8,5488
|
|
11
|
-
imsciences-0.5.4.7.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
12
|
-
imsciences-0.5.4.7.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
|
|
13
|
-
imsciences-0.5.4.7.dist-info/RECORD,,
|
|
File without changes
|