@@ -704,25 +704,27 @@ def test_groupby_multiindex_level_empty(self):
704
704
tm .assert_frame_equal (result , expected )
705
705
706
706
def test_default_observed_deprecated (self ):
707
- df = pd .DataFrame ([
708
- ['A' , 1 , 1 ], ['A' , 2 , 1 ], ['B' , 1 , 1 ]
709
- ], columns = [ 'x' , 'y' , 'z' ] )
710
- df .x = df .x .astype (' category' )
711
- df .y = df .x .astype (' category' )
707
+ df = pd .DataFrame (
708
+ [[ "A" , 1 , 1 ], ["A" , 2 , 1 ], ["B" , 1 , 1 ]], columns = [ "x" , "y" , "z" ]
709
+ )
710
+ df .x = df .x .astype (" category" )
711
+ df .y = df .x .astype (" category" )
712
712
713
- with tm .assert_produces_warning (expected_warning = FutureWarning ,
714
- check_stacklevel = False ):
715
- df .groupby (['x' , 'y' ])
713
+ with tm .assert_produces_warning (
714
+ expected_warning = FutureWarning , check_stacklevel = False
715
+ ):
716
+ df .groupby (["x" , "y" ])
716
717
717
718
with pytest .warns (None ) as any_warnings :
718
- df .groupby (['x' , 'y' ], observed = True )
719
- df .groupby (['x' , 'y' ], observed = False )
719
+ df .groupby (["x" , "y" ], observed = True )
720
+ df .groupby (["x" , "y" ], observed = False )
720
721
assert len (any_warnings ) == 0
721
722
722
- cat = pd .Categorical (['A' , 'B' , 'C' ], categories = ['A' , 'B' , 'C' , 'D' ])
723
+ cat = pd .Categorical (["A" , "B" , "C" ], categories = ["A" , "B" , "C" , "D" ])
723
724
s = Series (cat )
724
- with tm .assert_produces_warning (expected_warning = FutureWarning ,
725
- check_stacklevel = False ):
725
+ with tm .assert_produces_warning (
726
+ expected_warning = FutureWarning , check_stacklevel = False
727
+ ):
726
728
s .groupby (cat )
727
729
728
730
0 commit comments