Quantcast
Channel: Business Hours Between Two Dates in Pandas Dataframe (including holidays) - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Wojciech Moszczyński for Business Hours Between Two Dates in Pandas Dataframe (including holidays)

$
0
0

I suggest a simpler solution

import pandas as pd  from datetime import datetimeweekmask = 'Sun Mon Tue Wed Thu'exclude = [pd.datetime(2020, 5, 1),           pd.datetime(2020, 5, 2),           pd.datetime(2020, 5, 3)]pd.bdate_range('2020/4/30','2020/5/26',               freq='C',               weekmask = weekmask,               holidays=exclude)

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>