MCPcopy
hub / github.com/pandas-dev/pandas / test_business_freq

Method test_business_freq

pandas/tests/plotting/test_datetimelike.py:330–341  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

328 assert rs == xp
329
330 def test_business_freq(self):
331 bts = Series(range(5), period_range("2020-01-01", periods=5))
332 msg = r"PeriodDtype\[B\] is deprecated"
333 dt = bts.index[0].to_timestamp()
334 with tm.assert_produces_warning(FutureWarning, match=msg):
335 bts.index = period_range(start=dt, periods=len(bts), freq="B")
336 _, ax = mpl.pyplot.subplots()
337 bts.plot(ax=ax)
338 assert ax.get_lines()[0].get_xydata()[0, 0] == bts.index[0].ordinal
339 idx = ax.get_lines()[0].get_xdata()
340 with tm.assert_produces_warning(FutureWarning, match=msg):
341 assert PeriodIndex(data=idx).freqstr == "B"
342
343 def test_business_freq_convert(self):
344 bts = Series(

Callers

nothing calls this directly

Calls 6

SeriesClass · 0.90
period_rangeFunction · 0.90
PeriodIndexClass · 0.90
to_timestampMethod · 0.45
plotMethod · 0.45
get_linesMethod · 0.45

Tested by

no test coverage detected