-
-
Save BinarySpoon/09f6fe5b77922425038efe02a049ceb8 to your computer and use it in GitHub Desktop.
This file contains 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
# convert to quater --> | |
def convert_to_qtr(ym): | |
year, month = ym.split('-') | |
if month in ['01','02','03']: | |
result = year + 'q1' | |
elif month in ['04','05','06']: | |
result = year + 'q2' | |
elif month in ['07','08','09']: | |
result = year + 'q3' | |
else: | |
result = year + 'q4' | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment