@@ -740,23 +740,11 @@ def test_squeeze(self):
740
740
tm .assert_series_equal (s .squeeze (), s )
741
741
for df in [tm .makeTimeDataFrame ()]:
742
742
tm .assert_frame_equal (df .squeeze (), df )
743
- with catch_warnings (record = True ):
744
- simplefilter ("ignore" , FutureWarning )
745
- for p in [tm .makePanel ()]:
746
- tm .assert_panel_equal (p .squeeze (), p )
747
743
748
744
# squeezing
749
745
df = tm .makeTimeDataFrame ().reindex (columns = ['A' ])
750
746
tm .assert_series_equal (df .squeeze (), df ['A' ])
751
747
752
- with catch_warnings (record = True ):
753
- simplefilter ("ignore" , FutureWarning )
754
- p = tm .makePanel ().reindex (items = ['ItemA' ])
755
- tm .assert_frame_equal (p .squeeze (), p ['ItemA' ])
756
-
757
- p = tm .makePanel ().reindex (items = ['ItemA' ], minor_axis = ['A' ])
758
- tm .assert_series_equal (p .squeeze (), p .loc ['ItemA' , :, 'A' ])
759
-
760
748
# don't fail with 0 length dimensions GH11229 & GH8999
761
749
empty_series = Series ([], name = 'five' )
762
750
empty_frame = DataFrame ([empty_series ])
@@ -789,23 +777,13 @@ def test_numpy_squeeze(self):
789
777
tm .assert_series_equal (np .squeeze (df ), df ['A' ])
790
778
791
779
def test_transpose (self ):
792
- msg = (r"transpose\(\) got multiple values for "
793
- r"keyword argument 'axes'" )
794
780
for s in [tm .makeFloatSeries (), tm .makeStringSeries (),
795
781
tm .makeObjectSeries ()]:
796
782
# calls implementation in pandas/core/base.py
797
783
tm .assert_series_equal (s .transpose (), s )
798
784
for df in [tm .makeTimeDataFrame ()]:
799
785
tm .assert_frame_equal (df .transpose ().transpose (), df )
800
786
801
- with catch_warnings (record = True ):
802
- simplefilter ("ignore" , FutureWarning )
803
- for p in [tm .makePanel ()]:
804
- tm .assert_panel_equal (p .transpose (2 , 0 , 1 )
805
- .transpose (1 , 2 , 0 ), p )
806
- with pytest .raises (TypeError , match = msg ):
807
- p .transpose (2 , 0 , 1 , axes = (2 , 0 , 1 ))
808
-
809
787
def test_numpy_transpose (self ):
810
788
msg = "the 'axes' parameter is not supported"
811
789
@@ -821,13 +799,6 @@ def test_numpy_transpose(self):
821
799
with pytest .raises (ValueError , match = msg ):
822
800
np .transpose (df , axes = 1 )
823
801
824
- with catch_warnings (record = True ):
825
- simplefilter ("ignore" , FutureWarning )
826
- p = tm .makePanel ()
827
- tm .assert_panel_equal (np .transpose (
828
- np .transpose (p , axes = (2 , 0 , 1 )),
829
- axes = (1 , 2 , 0 )), p )
830
-
831
802
def test_take (self ):
832
803
indices = [1 , 5 , - 2 , 6 , 3 , - 1 ]
833
804
for s in [tm .makeFloatSeries (), tm .makeStringSeries (),
@@ -843,27 +814,12 @@ def test_take(self):
843
814
columns = df .columns )
844
815
tm .assert_frame_equal (out , expected )
845
816
846
- indices = [- 3 , 2 , 0 , 1 ]
847
- with catch_warnings (record = True ):
848
- simplefilter ("ignore" , FutureWarning )
849
- for p in [tm .makePanel ()]:
850
- out = p .take (indices )
851
- expected = Panel (data = p .values .take (indices , axis = 0 ),
852
- items = p .items .take (indices ),
853
- major_axis = p .major_axis ,
854
- minor_axis = p .minor_axis )
855
- tm .assert_panel_equal (out , expected )
856
-
857
817
def test_take_invalid_kwargs (self ):
858
818
indices = [- 3 , 2 , 0 , 1 ]
859
819
s = tm .makeFloatSeries ()
860
820
df = tm .makeTimeDataFrame ()
861
821
862
- with catch_warnings (record = True ):
863
- simplefilter ("ignore" , FutureWarning )
864
- p = tm .makePanel ()
865
-
866
- for obj in (s , df , p ):
822
+ for obj in (s , df ):
867
823
msg = r"take\(\) got an unexpected keyword argument 'foo'"
868
824
with pytest .raises (TypeError , match = msg ):
869
825
obj .take (indices , foo = 2 )
@@ -966,12 +922,6 @@ def test_equals(self):
966
922
assert a .equals (e )
967
923
assert e .equals (f )
968
924
969
- def test_describe_raises (self ):
970
- with catch_warnings (record = True ):
971
- simplefilter ("ignore" , FutureWarning )
972
- with pytest .raises (NotImplementedError ):
973
- tm .makePanel ().describe ()
974
-
975
925
def test_pipe (self ):
976
926
df = DataFrame ({'A' : [1 , 2 , 3 ]})
977
927
f = lambda x , y : x ** y
0 commit comments