def period_break(dates, period):
current = getattr(dates, period)<EOL>previous = getattr(dates - <NUM_LIT:1> * dates.freq, period)<EOL>return np.nonzero(current - previous)[<NUM_LIT:0>]<EOL>
Returns the indices where the given period changes.

Parameters
----------
dates : PeriodIndex
    Array of intervals to monitor.
period : string
    Name of the period to monitor.