Created
May 8, 2019 17:47
-
-
Save bugcy013/706e8c87c92d58632b55fc24c4dc8467 to your computer and use it in GitHub Desktop.
get_specific_days in a year
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
| import pandas as pd | |
| def get_specific_days(year, day): | |
| return pd.date_range( | |
| start=str(year), | |
| end=str(year+1), | |
| freq='W-%s' % day | |
| ).strftime('%Y%m%d').tolist() # %m%d%y | |
| days = get_specific_days(2019, "FRI") | |
| print days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment