imsciences 0.6.0.4__py3-none-any.whl → 0.6.0.5__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/datafunctions.py +9 -3
- {imsciences-0.6.0.4.dist-info → imsciences-0.6.0.5.dist-info}/METADATA +1 -1
- {imsciences-0.6.0.4.dist-info → imsciences-0.6.0.5.dist-info}/RECORD +5 -5
- {imsciences-0.6.0.4.dist-info → imsciences-0.6.0.5.dist-info}/WHEEL +0 -0
- {imsciences-0.6.0.4.dist-info → imsciences-0.6.0.5.dist-info}/top_level.txt +0 -0
imsciences/datafunctions.py
CHANGED
|
@@ -898,7 +898,7 @@ class dataprocessing:
|
|
|
898
898
|
start_year = int(starting_FY[2:])
|
|
899
899
|
|
|
900
900
|
def calculate_FY_vectorized(date_series):
|
|
901
|
-
years_since_start = ((date_series - start_date).dt.days /
|
|
901
|
+
years_since_start = ((date_series - start_date).dt.days / 364).astype(int)
|
|
902
902
|
fy = 'FY' + (start_year + years_since_start).astype(str)
|
|
903
903
|
if short_format == "Yes":
|
|
904
904
|
fy = 'FY' + fy.str[-2:]
|
|
@@ -907,8 +907,14 @@ class dataprocessing:
|
|
|
907
907
|
df['FY'] = calculate_FY_vectorized(df[index_col])
|
|
908
908
|
|
|
909
909
|
if half_years == "Yes" or combined_FY_and_H == "Yes":
|
|
910
|
-
|
|
911
|
-
|
|
910
|
+
def calculate_half_year_vectorized(date_series):
|
|
911
|
+
fy_years_since_start = ((date_series - start_date).dt.days / 364).astype(int)
|
|
912
|
+
fy_start_dates = start_date + fy_years_since_start * pd.DateOffset(years=1)
|
|
913
|
+
fy_end_of_h1 = fy_start_dates + pd.DateOffset(weeks=26) - pd.DateOffset(weeks=1)
|
|
914
|
+
half_year = np.where(date_series <= fy_end_of_h1, 'H1', 'H2')
|
|
915
|
+
return half_year
|
|
916
|
+
|
|
917
|
+
df['Half Years'] = calculate_half_year_vectorized(df[index_col])
|
|
912
918
|
|
|
913
919
|
if combined_FY_and_H == "Yes":
|
|
914
920
|
df['Financial Half Years'] = df['FY'] + ' ' + df['Half Years']
|
|
@@ -2,13 +2,13 @@ dataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
|
2
2
|
dataprocessing/data-processing-functions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
3
3
|
dataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
4
4
|
imsciences/__init__.py,sha256=GIPbLmWc06sVcOySWwNvMNUr6XGOHqPLryFIWgtpHh8,78
|
|
5
|
-
imsciences/datafunctions.py,sha256=
|
|
5
|
+
imsciences/datafunctions.py,sha256=v3dyZYr7Bo_tiqxiIxu9-wy43cwAkcCgySt3iKwhk4s,135389
|
|
6
6
|
imsciences/datapull.py,sha256=TPY0LDgOkcKTBk8OekbD0Grg5x0SomAK2dZ7MuT6X1E,19000
|
|
7
7
|
imsciencesdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
8
8
|
imsciencesdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
9
9
|
imsdataprocessing/__init__.py,sha256=quSwsLs6IuLoA5Rzi0ZD40xZaQudwDteF7_ai9JfTPk,32
|
|
10
10
|
imsdataprocessing/datafunctions.py,sha256=vE1vsZ8xOSbR9Bwlp9SWXwEHXQ0nFydwGkvzHXf2f1Y,41
|
|
11
|
-
imsciences-0.6.0.
|
|
12
|
-
imsciences-0.6.0.
|
|
13
|
-
imsciences-0.6.0.
|
|
14
|
-
imsciences-0.6.0.
|
|
11
|
+
imsciences-0.6.0.5.dist-info/METADATA,sha256=JdIOSMeD-hgHudpBJURanXcIeTLV5pUcqoB5yPOyZaw,854
|
|
12
|
+
imsciences-0.6.0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
13
|
+
imsciences-0.6.0.5.dist-info/top_level.txt,sha256=hsENS-AlDVRh8tQJ6-426iUQlla9bPcGc0-UlFF0_iU,11
|
|
14
|
+
imsciences-0.6.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|