コード例 #1
0
ファイル: test_packers.py プロジェクト: scarrucciu/pandas
    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)
コード例 #2
0
ファイル: test_packers.py プロジェクト: Langzzx/pandas
    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)
コード例 #3
0
ファイル: test_pytables.py プロジェクト: andreas-h/pandas
    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)
コード例 #4
0
ファイル: test_pytables.py プロジェクト: mitya57/pandas
    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)
コード例 #5
0
ファイル: test_packers.py プロジェクト: gustavodemari/pandas
    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)
コード例 #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)