本文整理匯總了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")))