示例#1
0
    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)
示例#2
0
    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)