0

I have a question about date range. I crated somethin like this:

date_rng = pd.date_range(start='25/12/2017', end='05/01/2018', freq='B',closed=None)

Result:

DatetimeIndex(['2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28',
           '2017-12-29', '2018-01-01', '2018-01-02', '2018-01-03',
           '2018-01-04', '2018-01-05'], dtype='datetime64[ns]', length=247, freq='B')

I need to remove 3 date: 2017-12-25, 2017-12-27 and 2018-01-04. I was looking for formulas that could help me but I didn't find the correct one. I also tried to change all of this into list but then I couldn't use remove formula because it didn't find the value in list... Anyone has idea how to fix it ?

Thanks All!

Tmiskiewicz
  • 389
  • 1
  • 11

1 Answers1

0

I am not sure what exactly you want but if you want only business days then you can use the following code:

pd.bdate_range('2018/1/1', '2018/12/31').date

Vikika
  • 318
  • 1
  • 9