14
Each of your if blocks does the same thing, but with different inputs.
if sun == 1:
first_sunday = np.busday_offset(start, 0, roll='forward', weekmask='Sun')
last_sunday = np.busday_offset(end, 0, roll='preceding', weekmask='Sun')
sun_count = np.busday_count(first_sunday, last_sunday, weekmask='Sun') + 1
for i in trange(...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
datetime × 986javascript × 187
python × 170
java × 131
c# × 128
beginner × 110
performance × 90
formatting × 76
c++ × 69
php × 67
python-3.x × 48
jquery × 42
ruby × 42
sql × 40
c × 33
validation × 33
parsing × 31
interval × 31
algorithm × 30
converting × 28
strings × 27
html × 24
sql-server × 23
object-oriented × 22
.net × 22