Skip to content

Instantly share code, notes, and snippets.

@bugcy013
Created May 8, 2019 17:47
Show Gist options
  • Save bugcy013/706e8c87c92d58632b55fc24c4dc8467 to your computer and use it in GitHub Desktop.
Save bugcy013/706e8c87c92d58632b55fc24c4dc8467 to your computer and use it in GitHub Desktop.
get_specific_days in a year
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