本文整理匯總了Python中pandas.tseries.offsets.FY5253Quarter方法的典型用法代碼示例。如果您正苦於以下問題:Python offsets.FY5253Quarter方法的具體用法?Python offsets.FY5253Quarter怎麽用?Python offsets.FY5253Quarter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas.tseries.offsets
的用法示例。
在下文中一共展示了offsets.FY5253Quarter方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: makeFY5253LastOfMonthQuarter
# 需要導入模塊: from pandas.tseries import offsets [as 別名]
# 或者: from pandas.tseries.offsets import FY5253Quarter [as 別名]
def makeFY5253LastOfMonthQuarter(*args, **kwds):
return FY5253Quarter(*args, variation="last", **kwds)
示例2: makeFY5253NearestEndMonthQuarter
# 需要導入模塊: from pandas.tseries import offsets [as 別名]
# 或者: from pandas.tseries.offsets import FY5253Quarter [as 別名]
def makeFY5253NearestEndMonthQuarter(*args, **kwds):
return FY5253Quarter(*args, variation="nearest", **kwds)
示例3: test_offset
# 需要導入模塊: from pandas.tseries import offsets [as 別名]
# 或者: from pandas.tseries.offsets import FY5253Quarter [as 別名]
def test_offset(self):
offset = makeFY5253NearestEndMonthQuarter(1, startingMonth=8,
weekday=WeekDay.THU,
qtr_with_extra_week=4)
MU = [datetime(2012, 5, 31),
datetime(2012, 8, 30), datetime(2012, 11, 29),
datetime(2013, 2, 28), datetime(2013, 5, 30)]
date = MU[0] + relativedelta(days=-1)
for expected in MU:
assert_offset_equal(offset, date, expected)
date = date + offset
assert_offset_equal(offset,
datetime(2012, 5, 31),
datetime(2012, 8, 30))
assert_offset_equal(offset,
datetime(2012, 5, 30),
datetime(2012, 5, 31))
offset2 = FY5253Quarter(weekday=5, startingMonth=12, variation="last",
qtr_with_extra_week=4)
assert_offset_equal(offset2,
datetime(2013, 1, 15),
datetime(2013, 3, 30))
示例4: test_fy5253qtr_onoffset_nearest
# 需要導入模塊: from pandas.tseries import offsets [as 別名]
# 或者: from pandas.tseries.offsets import FY5253Quarter [as 別名]
def test_fy5253qtr_onoffset_nearest():
# GH#19036
ts = Timestamp('1985-09-02 23:57:46.232550356-0300',
tz='Atlantic/Bermuda')
offset = FY5253Quarter(n=3, qtr_with_extra_week=1, startingMonth=2,
variation="nearest", weekday=0)
fast = offset.onOffset(ts)
slow = (ts + offset) - offset == ts
assert fast == slow
示例5: test_fy5253qtr_onoffset_last
# 需要導入模塊: from pandas.tseries import offsets [as 別名]
# 或者: from pandas.tseries.offsets import FY5253Quarter [as 別名]
def test_fy5253qtr_onoffset_last():
# GH#19036
offset = FY5253Quarter(n=-2, qtr_with_extra_week=1,
startingMonth=7, variation="last", weekday=2)
ts = Timestamp('2011-01-26 19:03:40.331096129+0200',
tz='Africa/Windhoek')
slow = (ts + offset) - offset == ts
fast = offset.onOffset(ts)
assert fast == slow