Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python pandas: offset Timestamp by business day

Tags:

python

pandas

The DateOffset seems to be the way to go, but I'm confused with the documentation. How can I offset by business days?

Thanks.

like image 859
jf328 Avatar asked Mar 17 '15 12:03

jf328


1 Answers

import datetime as dt
from pandas.datetools import BDay

ts = pd.Timestamp(dt.datetime.now())
>>> ts + BDay(5)

Out[42]: Timestamp('2015-03-24 06:48:50.133321')
like image 97
Alexander Avatar answered Oct 22 '22 01:10

Alexander