@@ -99,32 +99,32 @@ def test_indexing_sliced(self):
99
99
res = df .loc [:, 'X' ]
100
100
exp = tm .SubclassedSeries ([1 , 2 , 3 ], index = list ('abc' ), name = 'X' )
101
101
tm .assert_series_equal (res , exp )
102
- tm . assertIsInstance (res , tm .SubclassedSeries )
102
+ assert isinstance (res , tm .SubclassedSeries )
103
103
104
104
res = df .iloc [:, 1 ]
105
105
exp = tm .SubclassedSeries ([4 , 5 , 6 ], index = list ('abc' ), name = 'Y' )
106
106
tm .assert_series_equal (res , exp )
107
- tm . assertIsInstance (res , tm .SubclassedSeries )
107
+ assert isinstance (res , tm .SubclassedSeries )
108
108
109
109
res = df .loc [:, 'Z' ]
110
110
exp = tm .SubclassedSeries ([7 , 8 , 9 ], index = list ('abc' ), name = 'Z' )
111
111
tm .assert_series_equal (res , exp )
112
- tm . assertIsInstance (res , tm .SubclassedSeries )
112
+ assert isinstance (res , tm .SubclassedSeries )
113
113
114
114
res = df .loc ['a' , :]
115
115
exp = tm .SubclassedSeries ([1 , 4 , 7 ], index = list ('XYZ' ), name = 'a' )
116
116
tm .assert_series_equal (res , exp )
117
- tm . assertIsInstance (res , tm .SubclassedSeries )
117
+ assert isinstance (res , tm .SubclassedSeries )
118
118
119
119
res = df .iloc [1 , :]
120
120
exp = tm .SubclassedSeries ([2 , 5 , 8 ], index = list ('XYZ' ), name = 'b' )
121
121
tm .assert_series_equal (res , exp )
122
- tm . assertIsInstance (res , tm .SubclassedSeries )
122
+ assert isinstance (res , tm .SubclassedSeries )
123
123
124
124
res = df .loc ['c' , :]
125
125
exp = tm .SubclassedSeries ([3 , 6 , 9 ], index = list ('XYZ' ), name = 'c' )
126
126
tm .assert_series_equal (res , exp )
127
- tm . assertIsInstance (res , tm .SubclassedSeries )
127
+ assert isinstance (res , tm .SubclassedSeries )
128
128
129
129
def test_to_panel_expanddim (self ):
130
130
# GH 9762
@@ -173,15 +173,15 @@ def test_subclass_align(self):
173
173
exp2 = tm .SubclassedDataFrame ({'c' : [1 , 2 , np .nan , 4 , np .nan ],
174
174
'd' : [1 , 2 , np .nan , 4 , np .nan ]},
175
175
index = list ('ABCDE' ))
176
- tm . assertIsInstance (res1 , tm .SubclassedDataFrame )
176
+ assert isinstance (res1 , tm .SubclassedDataFrame )
177
177
tm .assert_frame_equal (res1 , exp1 )
178
- tm . assertIsInstance (res2 , tm .SubclassedDataFrame )
178
+ assert isinstance (res2 , tm .SubclassedDataFrame )
179
179
tm .assert_frame_equal (res2 , exp2 )
180
180
181
181
res1 , res2 = df1 .a .align (df2 .c )
182
- tm . assertIsInstance (res1 , tm .SubclassedSeries )
182
+ assert isinstance (res1 , tm .SubclassedSeries )
183
183
tm .assert_series_equal (res1 , exp1 .a )
184
- tm . assertIsInstance (res2 , tm .SubclassedSeries )
184
+ assert isinstance (res2 , tm .SubclassedSeries )
185
185
tm .assert_series_equal (res2 , exp2 .c )
186
186
187
187
def test_subclass_align_combinations (self ):
@@ -199,23 +199,23 @@ def test_subclass_align_combinations(self):
199
199
exp2 = pd .Series ([1 , 2 , np .nan , 4 , np .nan ],
200
200
index = list ('ABCDE' ), name = 'x' )
201
201
202
- tm . assertIsInstance (res1 , tm .SubclassedDataFrame )
202
+ assert isinstance (res1 , tm .SubclassedDataFrame )
203
203
tm .assert_frame_equal (res1 , exp1 )
204
- tm . assertIsInstance (res2 , tm .SubclassedSeries )
204
+ assert isinstance (res2 , tm .SubclassedSeries )
205
205
tm .assert_series_equal (res2 , exp2 )
206
206
207
207
# series + frame
208
208
res1 , res2 = s .align (df )
209
- tm . assertIsInstance (res1 , tm .SubclassedSeries )
209
+ assert isinstance (res1 , tm .SubclassedSeries )
210
210
tm .assert_series_equal (res1 , exp2 )
211
- tm . assertIsInstance (res2 , tm .SubclassedDataFrame )
211
+ assert isinstance (res2 , tm .SubclassedDataFrame )
212
212
tm .assert_frame_equal (res2 , exp1 )
213
213
214
214
def test_subclass_iterrows (self ):
215
215
# GH 13977
216
216
df = tm .SubclassedDataFrame ({'a' : [1 ]})
217
217
for i , row in df .iterrows ():
218
- tm . assertIsInstance (row , tm .SubclassedSeries )
218
+ assert isinstance (row , tm .SubclassedSeries )
219
219
tm .assert_series_equal (row , df .loc [i ])
220
220
221
221
def test_subclass_sparse_slice (self ):
0 commit comments