3RNN/Lib/site-packages/pandas/tests/scalar/interval/test_formats.py
2024-05-26 19:49:15 +02:00

12 lines
344 B
Python

from pandas import Interval
def test_interval_repr():
interval = Interval(0, 1)
assert repr(interval) == "Interval(0, 1, closed='right')"
assert str(interval) == "(0, 1]"
interval_left = Interval(0, 1, closed="left")
assert repr(interval_left) == "Interval(0, 1, closed='left')"
assert str(interval_left) == "[0, 1)"