Skip to content
Related Articles

Related Articles

Improve Article

Python | numpy.busday_count() method

  • Last Updated : 03 Oct, 2019

With the help of numpy.busday_count() method, we can get the value of all the valid days from starting date to ending date excluding ending date by using numpy.busday_count() method.

Syntax : numpy.busday_count(start_date, end_date)

Return : Return the valid date count.

Example #1 :
In this example we can see that by using numpy.busday_count() method, we are able to get the count of valid days between starting date and ending date.




# import numpy
import numpy as np
  
# using numpy.busday_count() method
gfg = np.busday_count('2019-09', '2019-10')
  
print(gfg)

Output :



21

Example #2 :




import numpy as np
  
# using numpy.busday_count() method
gfg = np.busday_count('2019-09', '2019-10', weekmask ='Sat')
  
print(gfg)

Output :

4

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :