@@ -156,7 +156,7 @@ def test_slicing_and_getting_ops(self):
156
156
# frame
157
157
res_df = df .iloc [2 :4 , :]
158
158
tm .assert_frame_equal (res_df , exp_df )
159
- assert is_categorical_dtype (res_df ["cats" ])
159
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
160
160
161
161
# row
162
162
res_row = df .iloc [2 , :]
@@ -166,7 +166,7 @@ def test_slicing_and_getting_ops(self):
166
166
# col
167
167
res_col = df .iloc [:, 0 ]
168
168
tm .assert_series_equal (res_col , exp_col )
169
- assert is_categorical_dtype (res_col )
169
+ assert is_categorical_dtype (res_col . dtype )
170
170
171
171
# single value
172
172
res_val = df .iloc [2 , 0 ]
@@ -176,7 +176,7 @@ def test_slicing_and_getting_ops(self):
176
176
# frame
177
177
res_df = df .loc ["j" :"k" , :]
178
178
tm .assert_frame_equal (res_df , exp_df )
179
- assert is_categorical_dtype (res_df ["cats" ])
179
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
180
180
181
181
# row
182
182
res_row = df .loc ["j" , :]
@@ -186,7 +186,7 @@ def test_slicing_and_getting_ops(self):
186
186
# col
187
187
res_col = df .loc [:, "cats" ]
188
188
tm .assert_series_equal (res_col , exp_col )
189
- assert is_categorical_dtype (res_col )
189
+ assert is_categorical_dtype (res_col . dtype )
190
190
191
191
# single value
192
192
res_val = df .loc ["j" , "cats" ]
@@ -197,7 +197,7 @@ def test_slicing_and_getting_ops(self):
197
197
# res_df = df.loc["j":"k",[0,1]] # doesn't work?
198
198
res_df = df .loc ["j" :"k" , :]
199
199
tm .assert_frame_equal (res_df , exp_df )
200
- assert is_categorical_dtype (res_df ["cats" ])
200
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
201
201
202
202
# row
203
203
res_row = df .loc ["j" , :]
@@ -207,7 +207,7 @@ def test_slicing_and_getting_ops(self):
207
207
# col
208
208
res_col = df .loc [:, "cats" ]
209
209
tm .assert_series_equal (res_col , exp_col )
210
- assert is_categorical_dtype (res_col )
210
+ assert is_categorical_dtype (res_col . dtype )
211
211
212
212
# single value
213
213
res_val = df .loc ["j" , df .columns [0 ]]
@@ -240,23 +240,23 @@ def test_slicing_and_getting_ops(self):
240
240
241
241
res_df = df .iloc [slice (2 , 4 )]
242
242
tm .assert_frame_equal (res_df , exp_df )
243
- assert is_categorical_dtype (res_df ["cats" ])
243
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
244
244
245
245
res_df = df .iloc [[2 , 3 ]]
246
246
tm .assert_frame_equal (res_df , exp_df )
247
- assert is_categorical_dtype (res_df ["cats" ])
247
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
248
248
249
249
res_col = df .iloc [:, 0 ]
250
250
tm .assert_series_equal (res_col , exp_col )
251
- assert is_categorical_dtype (res_col )
251
+ assert is_categorical_dtype (res_col . dtype )
252
252
253
253
res_df = df .iloc [:, slice (0 , 2 )]
254
254
tm .assert_frame_equal (res_df , df )
255
- assert is_categorical_dtype (res_df ["cats" ])
255
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
256
256
257
257
res_df = df .iloc [:, [0 , 1 ]]
258
258
tm .assert_frame_equal (res_df , df )
259
- assert is_categorical_dtype (res_df ["cats" ])
259
+ assert is_categorical_dtype (res_df ["cats" ]. dtype )
260
260
261
261
def test_slicing_doc_examples (self ):
262
262
0 commit comments