@@ -300,7 +300,9 @@ def test_pivot_with_interval_index(self, interval_values, dropna):
300
300
# GH 25814
301
301
df = DataFrame ({"A" : interval_values , "B" : 1 })
302
302
result = df .pivot_table (index = "A" , values = "B" , dropna = dropna )
303
- expected = DataFrame ({"B" : 1.0 }, index = Index (interval_values .unique (), name = "A" ))
303
+ expected = DataFrame (
304
+ {"B" : 1.0 }, index = Index (interval_values .unique (), name = "A" )
305
+ )
304
306
if not dropna :
305
307
expected = expected .astype (float )
306
308
tm .assert_frame_equal (result , expected )
@@ -1558,7 +1560,9 @@ def test_pivot_datetime_tz(self):
1558
1560
exp_col1 = Index (["value1" , "value1" ])
1559
1561
exp_col2 = Index (["a" , "b" ], name = "label" )
1560
1562
exp_col = MultiIndex .from_arrays ([exp_col1 , exp_col2 ])
1561
- expected = DataFrame ([[0.0 , 3.0 ], [1.0 , 4.0 ], [2.0 , 5.0 ]], index = exp_idx , columns = exp_col )
1563
+ expected = DataFrame (
1564
+ [[0.0 , 3.0 ], [1.0 , 4.0 ], [2.0 , 5.0 ]], index = exp_idx , columns = exp_col
1565
+ )
1562
1566
result = pivot_table (df , index = ["dt1" ], columns = ["label" ], values = ["value1" ])
1563
1567
tm .assert_frame_equal (result , expected )
1564
1568
@@ -1573,7 +1577,12 @@ def test_pivot_datetime_tz(self):
1573
1577
expected1 = DataFrame (
1574
1578
np .array (
1575
1579
[
1576
- [0 , 3 , 1 , 2 ,],
1580
+ [
1581
+ 0 ,
1582
+ 3 ,
1583
+ 1 ,
1584
+ 2 ,
1585
+ ],
1577
1586
[1 , 4 , 2 , 1 ],
1578
1587
[2 , 5 , 1 , 2 ],
1579
1588
],
@@ -1776,7 +1785,7 @@ def test_pivot_table_margins_name_with_aggfunc_list(self):
1776
1785
expected = DataFrame (table .values , index = ix , columns = cols )
1777
1786
tm .assert_frame_equal (table , expected )
1778
1787
1779
- def test_categorical_margins (self , observed , request ):
1788
+ def test_categorical_margins (self , observed ):
1780
1789
# GH 10989
1781
1790
df = DataFrame (
1782
1791
{"x" : np .arange (8 ), "y" : np .arange (8 ) // 4 , "z" : np .arange (8 ) % 2 }
@@ -1789,7 +1798,7 @@ def test_categorical_margins(self, observed, request):
1789
1798
table = df .pivot_table ("x" , "y" , "z" , dropna = observed , margins = True )
1790
1799
tm .assert_frame_equal (table , expected )
1791
1800
1792
- def test_categorical_margins_category (self , observed , request ):
1801
+ def test_categorical_margins_category (self , observed ):
1793
1802
df = DataFrame (
1794
1803
{"x" : np .arange (8 ), "y" : np .arange (8 ) // 4 , "z" : np .arange (8 ) % 2 }
1795
1804
)
0 commit comments