Python pandas.compat.PY37 Examples

The following are 12 code examples of pandas.compat.PY37(). 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.compat , or try the search function .
Example #1
Source File: test_offsets.py    From recruit with Apache License 2.0 5 votes vote down vote up
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 
Example #2
Source File: test_offsets.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_repr(self):
        assert repr(self.offset) == '<CustomBusinessDay>'
        assert repr(self.offset2) == '<2 * CustomBusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected 
Example #3
Source File: test_nat.py    From recruit with Apache License 2.0 5 votes vote down vote up
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 
Example #4
Source File: test_offsets.py    From vnpy_crypto with MIT License 5 votes vote down vote up
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 
Example #5
Source File: test_offsets.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_repr(self):
        assert repr(self.offset) == '<CustomBusinessDay>'
        assert repr(self.offset2) == '<2 * CustomBusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected 
Example #6
Source File: test_offsets.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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 
Example #7
Source File: test_offsets.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_repr(self):
        assert repr(self.offset) == '<CustomBusinessDay>'
        assert repr(self.offset2) == '<2 * CustomBusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected 
Example #8
Source File: test_nat.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
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 
Example #9
Source File: test_offsets.py    From coffeegrindsize with MIT License 5 votes vote down vote up
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 
Example #10
Source File: test_offsets.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_repr(self):
        assert repr(self.offset) == '<CustomBusinessDay>'
        assert repr(self.offset2) == '<2 * CustomBusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected 
Example #11
Source File: test_offsets.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
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 
Example #12
Source File: test_offsets.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_repr(self):
        assert repr(self.offset) == '<CustomBusinessDay>'
        assert repr(self.offset2) == '<2 * CustomBusinessDays>'

        if compat.PY37:
            expected = '<BusinessDay: offset=datetime.timedelta(days=1)>'
        else:
            expected = '<BusinessDay: offset=datetime.timedelta(1)>'
        assert repr(self.offset + timedelta(1)) == expected