Created
June 30, 2023 22:56
-
-
Save abhijeet-talaulikar/1c45e87f1433778b7eea4fe4ce8c9a16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if splits == "Q": | |
time_series = pd.PeriodIndex(dates, freq='Q').astype(str).str[-1].astype(int).values | |
elif splits == "H": | |
time_series = pd.PeriodIndex(dates, freq='Q').astype(str).str[-1].map({'1':1, '2':1, '3':2, '4':2}).values | |
elif splits == "YoY": | |
time_series = np.array([1]*52 + [2]*52) | |
else: | |
time_series = np.arange(104) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment