Exemple #1
0
    def test_copy(self):
        arr = self.na_data
        exp_sparr = SparseArray(arr)

        splist = SparseList()
        splist.append(arr[:5])
        splist.append(arr[5])

        cp = splist.copy()
        cp.append(arr[6:])
        self.assertEquals(splist.nchunks, 2)
        assert_sp_array_equal(cp.to_array(), exp_sparr)
Exemple #2
0
    def test_copy(self):
        with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
            arr = self.na_data
            exp_sparr = SparseArray(arr)

            splist = SparseList()
            splist.append(arr[:5])
            splist.append(arr[5])

            cp = splist.copy()
            cp.append(arr[6:])
            self.assertEqual(splist.nchunks, 2)
            tm.assert_sp_array_equal(cp.to_array(), exp_sparr)
Exemple #3
0
    def test_copy(self):
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            arr = self.na_data
            exp_sparr = SparseArray(arr)

            splist = SparseList()
            splist.append(arr[:5])
            splist.append(arr[5])

            cp = splist.copy()
            cp.append(arr[6:])
            self.assertEqual(splist.nchunks, 2)
            tm.assert_sp_array_equal(cp.to_array(), exp_sparr)