diff --git a/pandas/src/period.pyx b/pandas/src/period.pyx index 5565f25937394..956f066187ce8 100644 --- a/pandas/src/period.pyx +++ b/pandas/src/period.pyx @@ -469,6 +469,7 @@ def extract_ordinals(ndarray[object] values, freq): object p freqstr = Period._maybe_convert_freq(freq).freqstr + base_freq = frequencies.get_base_alias(freqstr) for i in range(n): p = values[i] @@ -479,8 +480,9 @@ def extract_ordinals(ndarray[object] values, freq): try: ordinals[i] = p.ordinal - if p.freqstr != freqstr: - msg = _DIFFERENT_FREQ_INDEX.format(freqstr, p.freqstr) + p_base_freq = frequencies.get_base_alias(p.freqstr) + if p_base_freq != base_freq: + msg = _DIFFERENT_FREQ_INDEX.format(base_freq, p_base_freq) raise IncompatibleFrequency(msg) except AttributeError: diff --git a/pandas/tests/plotting/test_series.py b/pandas/tests/plotting/test_series.py index e752197c6ad77..01ba0d99ee472 100644 --- a/pandas/tests/plotting/test_series.py +++ b/pandas/tests/plotting/test_series.py @@ -802,6 +802,11 @@ def test_custom_business_day_freq(self): _check_plot_works(s.plot) + def test_non_standard_intervals(self): + idx = pd.period_range('2000-01-01', '2000-01-05', freq='6H') + s = Series(np.random.randn(len(idx)), index=idx) + _check_plot_works(s.plot) + if __name__ == '__main__': nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],