Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get third friday of the month

import calendar

c = calendar.Calendar(firstweekday=calendar.SUNDAY)

year = 2015; month = 2

monthcal = c.monthdatescalendar(year,month)
third_friday = [day for week in monthcal for day in week if 
                day.weekday() == calendar.FRIDAY and 
                day.month == month][2]
Comment

PREVIOUS NEXT
Code Example
Python :: python turtle delay 
Python :: how to get pytroch model layer name 
Python :: tensorflow metrics accuracy 
Python :: dataframe shift python 
Python :: python subset 
Python :: python string generator 
Python :: flatmap in python 
Python :: python input list of ints 
Python :: create virtual env pyhton3 
Python :: python code to get wifi 
Python :: pandas apply 
Python :: how to parse timestamp in python 
Python :: pygame surface 
Python :: realtime output subprocess 
Python :: Python random integer number between min, max 
Python :: TypeError: ‘float’ object is not callable 
Python :: pandas rolling mean 
Python :: python set match two list 
Python :: strip whitespace python 
Python :: group by month and day pandas 
Python :: String search from multiple files 
Python :: Check np.nan value 
Python :: python print every n loops 
Python :: python To find the sum of all the elements in a list. 
Python :: remove key from dictionary 
Python :: django abstractuser 
Python :: python convert 
Python :: how to stop thread python 
Python :: update all pip packages 
Python :: python decorator 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =