Python pandas.tseries.converter.time2num() Examples

The following are 8 code examples of pandas.tseries.converter.time2num(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.tseries.converter , or try the search function .
Example #1
Source File: test_converter.py    From vnpy_crypto with MIT License 6 votes vote down vote up
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 
Example #2
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 6 votes vote down vote up
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 
Example #3
Source File: test_converter.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert (converter.time2num("00:01") == converter.time2num(u("00:01"))) 
Example #4
Source File: test_converter.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert (converter.time2num("00:01") == converter.time2num(u("00:01"))) 
Example #5
Source File: test_converter.py    From Computable with MIT License 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert(converter.time2num("00:01") == converter.time2num(u("00:01"))) 
Example #6
Source File: test_converter.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert (converter.time2num("00:01") == converter.time2num(u("00:01"))) 
Example #7
Source File: test_converter.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert (converter.time2num("00:01") == converter.time2num(u("00:01"))) 
Example #8
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_timtetonum_accepts_unicode():
    assert (converter.time2num("00:01") == converter.time2num(u("00:01")))