|
8 | 8 | from pandas.compat import PY36, lrange, range
|
9 | 9 |
|
10 | 10 | from pandas import DataFrame, Index, MultiIndex, Series
|
11 |
| -from pandas.tests.frame.common import TestData |
12 | 11 | import pandas.util.testing as tm
|
13 | 12 | from pandas.util.testing import assert_frame_equal
|
14 | 13 |
|
15 | 14 | # Column add, remove, delete.
|
16 | 15 |
|
17 | 16 |
|
18 |
| -class TestDataFrameMutateColumns(TestData): |
| 17 | +class TestDataFrameMutateColumns(): |
19 | 18 |
|
20 | 19 | def test_assign(self):
|
21 | 20 | df = DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
|
@@ -193,9 +192,9 @@ def test_insert(self):
|
193 | 192 | exp = DataFrame(data={'X': ['x', 'y', 'z']}, index=['A', 'B', 'C'])
|
194 | 193 | assert_frame_equal(df, exp)
|
195 | 194 |
|
196 |
| - def test_delitem(self): |
197 |
| - del self.frame['A'] |
198 |
| - assert 'A' not in self.frame |
| 195 | + def test_delitem(self, float_frame): |
| 196 | + del float_frame['A'] |
| 197 | + assert 'A' not in float_frame |
199 | 198 |
|
200 | 199 | def test_delitem_multiindex(self):
|
201 | 200 | midx = MultiIndex.from_product([['A', 'B'], [1, 2]])
|
@@ -223,16 +222,16 @@ def test_delitem_multiindex(self):
|
223 | 222 | with pytest.raises(KeyError):
|
224 | 223 | del df['A']
|
225 | 224 |
|
226 |
| - def test_pop(self): |
227 |
| - self.frame.columns.name = 'baz' |
| 225 | + def test_pop(self, float_frame): |
| 226 | + float_frame.columns.name = 'baz' |
228 | 227 |
|
229 |
| - self.frame.pop('A') |
230 |
| - assert 'A' not in self.frame |
| 228 | + float_frame.pop('A') |
| 229 | + assert 'A' not in float_frame |
231 | 230 |
|
232 |
| - self.frame['foo'] = 'bar' |
233 |
| - self.frame.pop('foo') |
234 |
| - assert 'foo' not in self.frame |
235 |
| - assert self.frame.columns.name == 'baz' |
| 231 | + float_frame['foo'] = 'bar' |
| 232 | + float_frame.pop('foo') |
| 233 | + assert 'foo' not in float_frame |
| 234 | + assert float_frame.columns.name == 'baz' |
236 | 235 |
|
237 | 236 | # gh-10912: inplace ops cause caching issue
|
238 | 237 | a = DataFrame([[1, 2, 3], [4, 5, 6]], columns=[
|
|
0 commit comments