@@ -234,16 +234,16 @@ def test_from_arrays_empty():
234
234
tm .assert_index_equal (result , expected )
235
235
236
236
237
- @pytest .mark .parametrize ('invalid_array' ,[
238
- pytest .param (1 ),
239
- pytest .param ([1 ]),
240
- pytest .param ([1 , 2 ]),
241
- pytest .param ([[1 ], 2 ]),
242
- pytest .param ('a' ),
243
- pytest .param (['a' ]),
244
- pytest .param (['a' , 'b' ]),
245
- pytest .param ([['a' ], 'b' ]),
246
- ]
237
+ @pytest .mark .parametrize ('invalid_array' , [
238
+ pytest .param (1 ),
239
+ pytest .param ([1 ]),
240
+ pytest .param ([1 , 2 ]),
241
+ pytest .param ([[1 ], 2 ]),
242
+ pytest .param ('a' ),
243
+ pytest .param (['a' ]),
244
+ pytest .param (['a' , 'b' ]),
245
+ pytest .param ([['a' ], 'b' ]),
246
+ ]
247
247
)
248
248
def test_from_arrays_invalid_input (invalid_array ):
249
249
invalid_inputs = [1 , [1 ], [1 , 2 ], [[1 ], 2 ],
@@ -252,11 +252,11 @@ def test_from_arrays_invalid_input(invalid_array):
252
252
pytest .raises (TypeError , MultiIndex .from_arrays , arrays = i )
253
253
254
254
255
- @pytest .mark .parametrize ('idx1, idx2' ,[
256
- pytest .param ([1 , 2 , 3 ], ['a' , 'b' ]),
257
- pytest .param ([], ['a' , 'b' ]),
258
- pytest .param ([1 , 2 , 3 ], [])
259
- ]
255
+ @pytest .mark .parametrize ('idx1, idx2' , [
256
+ pytest .param ([1 , 2 , 3 ], ['a' , 'b' ]),
257
+ pytest .param ([], ['a' , 'b' ]),
258
+ pytest .param ([1 , 2 , 3 ], [])
259
+ ]
260
260
)
261
261
def test_from_arrays_different_lengths (idx1 , idx2 ):
262
262
# see gh-13599
@@ -321,16 +321,16 @@ def test_from_product_empty_one_level():
321
321
tm .assert_index_equal (result .levels [0 ], expected )
322
322
323
323
324
- @pytest .mark .parametrize ('first, second' ,[
325
- ([],[]),
324
+ @pytest .mark .parametrize ('first, second' , [
325
+ ([], []),
326
326
(['foo' , 'bar' , 'baz' ], []),
327
327
([], ['a' , 'b' , 'c' ]),
328
328
])
329
329
def test_from_product_empty_two_levels (first , second ):
330
330
names = ['A' , 'B' ]
331
331
result = MultiIndex .from_product ([first , second ], names = names )
332
332
expected = MultiIndex (levels = [first , second ],
333
- labels = [[], []], names = names )
333
+ labels = [[], []], names = names )
334
334
tm .assert_index_equal (result , expected )
335
335
336
336
@@ -341,7 +341,7 @@ def test_from_product_empty_three_levels(N):
341
341
lvl2 = lrange (N )
342
342
result = MultiIndex .from_product ([[], lvl2 , []], names = names )
343
343
expected = MultiIndex (levels = [[], lvl2 , []],
344
- labels = [[], [], []], names = names )
344
+ labels = [[], [], []], names = names )
345
345
tm .assert_index_equal (result , expected )
346
346
347
347
@@ -370,12 +370,12 @@ def test_from_product_datetimeindex():
370
370
def test_from_product_index_series_categorical (ordered , f ):
371
371
# GH13743
372
372
first = ['foo' , 'bar' ]
373
-
373
+
374
374
idx = pd .CategoricalIndex (list ("abcaab" ), categories = list ("bac" ),
375
- ordered = ordered )
375
+ ordered = ordered )
376
376
expected = pd .CategoricalIndex (list ("abcaab" ) + list ("abcaab" ),
377
- categories = list ("bac" ),
378
- ordered = ordered )
377
+ categories = list ("bac" ),
378
+ ordered = ordered )
379
379
380
380
result = pd .MultiIndex .from_product ([first , f (idx )])
381
381
tm .assert_index_equal (result .get_level_values (1 ), expected )
@@ -437,13 +437,13 @@ def test_create_index_existing_name(idx):
437
437
result = pd .Index (index , names = ['A' , 'B' ])
438
438
expected = Index (
439
439
Index ([
440
- ('foo' , 'one' ), ('foo' , 'two' ),
441
- ('bar' , 'one' ), ('baz' , 'two' ),
440
+ ('foo' , 'one' ), ('foo' , 'two' ),
441
+ ('bar' , 'one' ), ('baz' , 'two' ),
442
442
('qux' , 'one' ), ('qux' , 'two' )],
443
443
dtype = 'object'
444
444
),
445
445
names = ['A' , 'B' ]
446
- )
446
+ )
447
447
tm .assert_index_equal (result , expected )
448
448
449
449
0 commit comments