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

Function _period_break

pandas/plotting/_matplotlib/converter.py:500–512  ·  view source on GitHub ↗

Returns the indices where the given period changes. Parameters ---------- dates : PeriodIndex Array of intervals to monitor. period : str Name of the period to monitor.

(dates: PeriodIndex, period: str)

Source from the content-addressed store, hash-verified

498
499
500def _period_break(dates: PeriodIndex, period: str) -> npt.NDArray[np.intp]:
501 """
502 Returns the indices where the given period changes.
503
504 Parameters
505 ----------
506 dates : PeriodIndex
507 Array of intervals to monitor.
508 period : str
509 Name of the period to monitor.
510 """
511 mask = _period_break_mask(dates, period)
512 return np.nonzero(mask)[0]
513
514
515def _period_break_mask(dates: PeriodIndex, period: str) -> npt.NDArray[np.bool_]:

Callers 3

_daily_finderFunction · 0.85
_minute_finderFunction · 0.85
_second_finderFunction · 0.85

Calls 2

_period_break_maskFunction · 0.85
nonzeroMethod · 0.80

Tested by

no test coverage detected