Python | numpy.busday_count () method



Using the numpy.busday_count() method, we can get the value of all valid days from the start date to the end date, excluding the end date, using numpy.busday_count ( ) .

Syntax: numpy.busday_count (start_date, end_date)

Return: Return the valid date count.

Example # 1:
In this example, we can see that with numpy.busday_count () we can get the number of valid days between start and end date.

# NumPy import

import numpy as np

  
# using the numpy.busday_count () method

gfg = np.busday_count ( ` 2019-09` , `2019-10` )

  

print (gfg)

Output:

21

Example # 2:

import numpy as np

 
# using the numpy.busday_count () method

gfg = np.busday_count ( `2019-09` , ` 2019-10` , weekmask = `Sat` )

 

print (gfg)

Output:

4