def test_resample_empty(self):
        ts = _simple_ts('1/1/2000', '2/1/2000')[:0]

        result = ts.resample('A')
        self.assertEqual(len(result), 0)
        self.assertEqual(result.index.freqstr, 'A-DEC')

        result = ts.resample('A', kind='period')
        self.assertEqual(len(result), 0)
        self.assertEqual(result.index.freqstr, 'A-DEC')

        xp = DataFrame()
        rs = xp.resample('A')
        assert_frame_equal(xp, rs)

        # Empty series were sometimes causing a segfault (for the functions
        # with Cython bounds-checking disabled) or an IndexError.  We just run
        # them to ensure they no longer do.  (GH #10228)
        for index in tm.all_timeseries_index_generator(0):
            for dtype in (np.float, np.int, np.object, 'datetime64[ns]'):
                for how in ('count', 'mean', 'min', 'ohlc', 'last', 'prod'):
                    empty_series = pd.Series([], index, dtype)
                    try:
                        empty_series.resample('d', how)
                    except DataError:
                        # Ignore these since some combinations are invalid
                        # (ex: doing mean with dtype of np.object)
                        pass