Exemple #1
0
    def test_sparse_panel(self):

        items = ["x", "y", "z"]
        p = Panel(dict((i, tm.makeDataFrame().ix[:2, :2]) for i in items))
        sp = p.to_sparse()

        self._check_roundtrip(sp, tm.assert_panel_equal, check_panel_type=True)

        sp2 = p.to_sparse(kind="integer")
        self._check_roundtrip(sp2, tm.assert_panel_equal, check_panel_type=True)

        sp3 = p.to_sparse(fill_value=0)
        self._check_roundtrip(sp3, tm.assert_panel_equal, check_panel_type=True)
Exemple #2
0
    def test_sparse_panel(self):

        with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
            items = ["x", "y", "z"]
            p = Panel(dict((i, tm.makeDataFrame().ix[:2, :2]) for i in items))
            sp = p.to_sparse()

            self._check_roundtrip(sp, tm.assert_panel_equal, check_panel_type=True)

            sp2 = p.to_sparse(kind="integer")
            self._check_roundtrip(sp2, tm.assert_panel_equal, check_panel_type=True)

            sp3 = p.to_sparse(fill_value=0)
            self._check_roundtrip(sp3, tm.assert_panel_equal, check_panel_type=True)
Exemple #3
0
    def test_sparse_panel(self):
        items = ['x', 'y', 'z']
        p = Panel(dict((i, tm.makeDataFrame()) for i in items))
        sp = p.to_sparse()

        self._check_roundtrip(sp, tm.assert_panel_equal,
                              check_panel_type=True)

        sp2 = p.to_sparse(kind='integer')
        self._check_roundtrip(sp2, tm.assert_panel_equal,
                              check_panel_type=True)

        sp3 = p.to_sparse(fill_value=0)
        self._check_roundtrip(sp3, tm.assert_panel_equal,
                              check_panel_type=True)
Exemple #4
0
    def test_sparse_panel(self):
        items = ['x', 'y', 'z']
        p = Panel(dict((i, tm.makeDataFrame()) for i in items))
        sp = p.to_sparse()

        self._check_double_roundtrip(sp, tm.assert_panel_equal,
                                     check_panel_type=True)

        sp2 = p.to_sparse(kind='integer')
        self._check_double_roundtrip(sp2, tm.assert_panel_equal,
                                     check_panel_type=True)

        sp3 = p.to_sparse(fill_value=0)
        self._check_double_roundtrip(sp3, tm.assert_panel_equal,
                                     check_panel_type=True)
Exemple #5
0
    def test_sparse_panel(self):

        with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
            items = ['x', 'y', 'z']
            p = Panel(dict((i, tm.makeDataFrame().ix[:2, :2]) for i in items))
            sp = p.to_sparse()

            self._check_roundtrip(sp, tm.assert_panel_equal,
                                  check_panel_type=True)

            sp2 = p.to_sparse(kind='integer')
            self._check_roundtrip(sp2, tm.assert_panel_equal,
                                  check_panel_type=True)

            sp3 = p.to_sparse(fill_value=0)
            self._check_roundtrip(sp3, tm.assert_panel_equal,
                                  check_panel_type=True)
Exemple #6
0
    def test_sparse_panel(self):

        with warnings.catch_warnings(record=True):

            items = ['x', 'y', 'z']
            p = Panel(dict((i, tm.makeDataFrame().ix[:2, :2]) for i in items))
            sp = p.to_sparse()

            self._check_roundtrip(sp, tm.assert_panel_equal,
                                  check_panel_type=True)

            sp2 = p.to_sparse(kind='integer')
            self._check_roundtrip(sp2, tm.assert_panel_equal,
                                  check_panel_type=True)

            sp3 = p.to_sparse(fill_value=0)
            self._check_roundtrip(sp3, tm.assert_panel_equal,
                                  check_panel_type=True)