本文整理汇总了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
示例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