当前位置: 首页>>代码示例>>Python>>正文


Python offsets.FY5253Quarter方法代码示例

本文整理汇总了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) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:test_fiscal.py

示例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) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:test_fiscal.py

示例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)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:29,代码来源:test_fiscal.py

示例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 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:11,代码来源:test_fiscal.py

示例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 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:11,代码来源:test_fiscal.py


注:本文中的pandas.tseries.offsets.FY5253Quarter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。