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


Python compat.PY37属性代码示例

本文整理汇总了Python中pandas.compat.PY37属性的典型用法代码示例。如果您正苦于以下问题:Python compat.PY37属性的具体用法?Python compat.PY37怎么用?Python compat.PY37使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在pandas.compat的用法示例。


在下文中一共展示了compat.PY37属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_repr

# 需要导入模块: from pandas import compat [as 别名]
# 或者: from pandas.compat import PY37 [as 别名]
def test_repr(self):
        assert repr(self.offset) == '<BusinessDay>'
        assert repr(self.offset2) == '<2 * BusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:11,代码来源:test_offsets.py

示例2: test_overlap_public_nat_methods

# 需要导入模块: from pandas import compat [as 别名]
# 或者: from pandas.compat import PY37 [as 别名]
def test_overlap_public_nat_methods(klass, expected):
    # see gh-17327
    #
    # NaT should have *most* of the Timestamp and Timedelta methods.
    # In case when Timestamp, Timedelta, and NaT are overlap, the overlap
    # is considered to be with Timestamp and NaT, not Timedelta.

    # "fromisoformat" was introduced in 3.7
    if klass is Timestamp and not compat.PY37:
        expected.remove("fromisoformat")

    assert _get_overlap_public_nat_methods(klass) == expected 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:test_nat.py


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