How can I calculate number of days between two dates excluding weekends?
I think the cleanest solution is to use the numpy function busday_count
busday_count
import numpy as np import datetime as dt start = dt.date( 2014, 1, 1 ) end = dt.date( 2014, 1, 16 ) days = np.busday_count( start, end )
2.1m questions
2.1m answers
60 comments
57.0k users