otp.Quarter#
- Quarter(n)#
onetick.py object representing Quarter datetime offset. Can be added to or subtracted from:
otp.datetime
objectsSource
columns of datetime type
- Parameters
n (int, otp.Column) – offset integer value or column of otp.Source
Examples
Add to or subtract from otp.datetime object:
>>> otp.datetime(2012, 12, 12, 12) + otp.Quarter(1) 2013-03-12 12:00:00 >>> otp.datetime(2012, 12, 12, 12) - otp.Quarter(1) 2012-09-12 12:00:00
Use offset in columns:
>>> t = otp.Tick(A=1) >>> t['T'] = otp.datetime(2012, 12, 12, 12, tz='GMT') >>> t['T'] += otp.Quarter(t['A']) >>> otp.run(t, start=otp.datetime(2003, 12, 2), end=otp.datetime(2003, 12, 3), timezone='GMT') Time T A 0 2003-12-02 2013-03-12 12:00:00 1