本文整理汇总了Python中pandas._libs.tslibs.timezones._p_tz_cache_key方法的典型用法代码示例。如果您正苦于以下问题:Python timezones._p_tz_cache_key方法的具体用法?Python timezones._p_tz_cache_key怎么用?Python timezones._p_tz_cache_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas._libs.tslibs.timezones
的用法示例。
在下文中一共展示了timezones._p_tz_cache_key方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cache_keys_are_distinct_for_pytz_vs_dateutil
# 需要导入模块: from pandas._libs.tslibs import timezones [as 别名]
# 或者: from pandas._libs.tslibs.timezones import _p_tz_cache_key [as 别名]
def test_cache_keys_are_distinct_for_pytz_vs_dateutil(tz_name):
if tz_name == "UTC":
pytest.skip("UTC: special case in dateutil")
tz_p = timezones.maybe_get_tz(tz_name)
tz_d = timezones.maybe_get_tz("dateutil/" + tz_name)
if tz_d is None:
pytest.skip(tz_name + ": dateutil does not know about this one")
assert timezones._p_tz_cache_key(tz_p) != timezones._p_tz_cache_key(tz_d)
示例2: test_cache_keys_are_distinct_for_pytz_vs_dateutil
# 需要导入模块: from pandas._libs.tslibs import timezones [as 别名]
# 或者: from pandas._libs.tslibs.timezones import _p_tz_cache_key [as 别名]
def test_cache_keys_are_distinct_for_pytz_vs_dateutil(tz_name):
if tz_name == 'UTC':
# skip utc as it's a special case in dateutil
return
tz_p = timezones.maybe_get_tz(tz_name)
tz_d = timezones.maybe_get_tz('dateutil/' + tz_name)
if tz_d is None:
# skip timezones that dateutil doesn't know about.
return
assert timezones._p_tz_cache_key(tz_p) != timezones._p_tz_cache_key(tz_d)
示例3: test_cache_keys_are_distinct_for_pytz_vs_dateutil
# 需要导入模块: from pandas._libs.tslibs import timezones [as 别名]
# 或者: from pandas._libs.tslibs.timezones import _p_tz_cache_key [as 别名]
def test_cache_keys_are_distinct_for_pytz_vs_dateutil(self):
tzs = pytz.common_timezones
for tz_name in tzs:
if tz_name == 'UTC':
# skip utc as it's a special case in dateutil
continue
tz_p = timezones.maybe_get_tz(tz_name)
tz_d = timezones.maybe_get_tz('dateutil/' + tz_name)
if tz_d is None:
# skip timezones that dateutil doesn't know about.
continue
assert (timezones._p_tz_cache_key(tz_p) !=
timezones._p_tz_cache_key(tz_d))