本文整理汇总了Python中pandas.tseries.converter.time2num方法的典型用法代码示例。如果您正苦于以下问题:Python converter.time2num方法的具体用法?Python converter.time2num怎么用?Python converter.time2num使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.tseries.converter
的用法示例。
在下文中一共展示了converter.time2num方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_time_formatter
# 需要导入模块: from pandas.tseries import converter [as 别名]
# 或者: from pandas.tseries.converter import time2num [as 别名]
def test_time_formatter(self):
# issue 18478
# time2num(datetime.time.min)
rs = self.tc(0)
xp = '00:00'
assert rs == xp
# time2num(datetime.time.max)
rs = self.tc(86399.999999)
xp = '23:59:59.999999'
assert rs == xp
# some other times
rs = self.tc(90000)
xp = '01:00'
assert rs == xp
rs = self.tc(3723)
xp = '01:02:03'
assert rs == xp
rs = self.tc(39723.2)
xp = '11:02:03.200'
assert rs == xp
示例2: test_timtetonum_accepts_unicode
# 需要导入模块: from pandas.tseries import converter [as 别名]
# 或者: from pandas.tseries.converter import time2num [as 别名]
def test_timtetonum_accepts_unicode():
assert (converter.time2num("00:01") == converter.time2num(u("00:01")))
示例3: test_timtetonum_accepts_unicode
# 需要导入模块: from pandas.tseries import converter [as 别名]
# 或者: from pandas.tseries.converter import time2num [as 别名]
def test_timtetonum_accepts_unicode():
assert(converter.time2num("00:01") == converter.time2num(u("00:01")))