def test_value_counts(self): from pandas.tools.tile import cut arr = np.random.randn(4) factor = cut(arr, 4) self.assert_(isinstance(factor, Categorical)) result = value_counts(factor) expected = value_counts(np.asarray(factor)) tm.assert_series_equal(result, expected)
def test_value_counts(self): from pandas.tools.tile import cut arr = np.random.randn(4) factor = cut(arr, 4) self.assert_(isinstance(factor, Factor)) result = value_counts(factor) expected = value_counts(np.asarray(factor)) tm.assert_series_equal(result, expected)