/usr/local/lib64/python3.6/site-packages/pandas/tests/indexes/period
NameSizeModeActions
__pycache__/-0755rm
test_asfreq.py54320644editdlrm
test_astype.py61890644editdlrm
test_constructors.py198310644editdlrm
test_factorize.py12670644editdlrm
test_fillna.py11040644editdlrm
test_formats.py69710644editdlrm
test_indexing.py290170644editdlrm
test_join.py14100644editdlrm
test_monotonic.py12450644editdlrm
test_ops.py126420644editdlrm
test_partial_slicing.py53230644editdlrm
test_period.py214620644editdlrm
test_period_range.py39540644editdlrm
test_scalar_compat.py11230644editdlrm
test_searchsorted.py26220644editdlrm
test_setops.py120870644editdlrm
test_shift.py43980644editdlrm
test_tools.py10060644editdlrm
test_to_timestamp.py36120644editdlrm
__init__.py00644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pandas/tests/indexes/period/test_tools.py (1006B)
import numpy as np import pytest from pandas import Period, PeriodIndex, period_range import pandas._testing as tm class TestPeriodRepresentation: """ Wish to match NumPy units """ def _check_freq(self, freq, base_date): rng = period_range(start=base_date, periods=10, freq=freq) exp = np.arange(10, dtype=np.int64) tm.assert_numpy_array_equal(rng.asi8, exp) def test_annual(self): self._check_freq("A", 1970) def test_monthly(self): self._check_freq("M", "1970-01") @pytest.mark.parametrize("freq", ["W-THU", "D", "B", "H", "T", "S", "L", "U", "N"]) def test_freq(self, freq): self._check_freq(freq, "1970-01-01") class TestPeriodIndexConversion: def test_tolist(self): index = period_range(freq="A", start="1/1/2001", end="12/1/2009") rs = index.tolist() for x in rs: assert isinstance(x, Period) recon = PeriodIndex(rs) tm.assert_index_equal(index, recon)