@@ -861,37 +861,37 @@ def test_ptp(self):
861
861
assert np .ptp (ser ) == np .ptp (arr )
862
862
863
863
# GH11163
864
- s = Series ([3 , 5 , np .nan , - 3 , 10 ])
865
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
866
- assert s .ptp () == 13
867
- assert pd .isna (s .ptp (skipna = False ))
868
-
869
- mi = pd .MultiIndex .from_product ([["a" , "b" ], [1 , 2 , 3 ]])
870
- s = pd .Series ([1 , np .nan , 7 , 3 , 5 , np .nan ], index = mi )
871
-
872
- expected = pd .Series ([6 , 2 ], index = ["a" , "b" ], dtype = np .float64 )
873
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
874
- tm .assert_series_equal (s .ptp (level = 0 ), expected )
875
-
876
- expected = pd .Series ([np .nan , np .nan ], index = ["a" , "b" ])
877
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
878
- tm .assert_series_equal (s .ptp (level = 0 , skipna = False ), expected )
879
-
880
- msg = "No axis named 1 for object type <class 'pandas.core.series.Series'>"
881
- with pytest .raises (ValueError , match = msg ):
882
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
883
- s .ptp (axis = 1 )
884
-
885
- s = pd .Series (["a" , "b" , "c" , "d" , "e" ])
886
- msg = r"unsupported operand type\(s\) for -: 'str' and 'str'"
887
- with pytest .raises (TypeError , match = msg ):
888
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
889
- s .ptp ()
890
-
891
- msg = r"Series\.ptp does not implement numeric_only\."
892
- with pytest .raises (NotImplementedError , match = msg ):
893
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
894
- s .ptp (numeric_only = True )
864
+ # s = Series([3, 5, np.nan, -3, 10])
865
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
866
+ # assert s.ptp() == 13
867
+ # assert pd.isna(s.ptp(skipna=False))
868
+
869
+ # mi = pd.MultiIndex.from_product([["a", "b"], [1, 2, 3]])
870
+ # s = pd.Series([1, np.nan, 7, 3, 5, np.nan], index=mi)
871
+
872
+ # expected = pd.Series([6, 2], index=["a", "b"], dtype=np.float64)
873
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
874
+ # tm.assert_series_equal(s.ptp(level=0), expected)
875
+
876
+ # expected = pd.Series([np.nan, np.nan], index=["a", "b"])
877
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
878
+ # tm.assert_series_equal(s.ptp(level=0, skipna=False), expected)
879
+
880
+ # msg = "No axis named 1 for object type <class 'pandas.core.series.Series'>"
881
+ # with pytest.raises(ValueError, match=msg):
882
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
883
+ # s.ptp(axis=1)
884
+
885
+ # s = pd.Series(["a", "b", "c", "d", "e"])
886
+ # msg = r"unsupported operand type\(s\) for -: 'str' and 'str'"
887
+ # with pytest.raises(TypeError, match=msg):
888
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
889
+ # s.ptp()
890
+
891
+ # msg = r"Series\.ptp does not implement numeric_only\."
892
+ # with pytest.raises(NotImplementedError, match=msg):
893
+ # with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
894
+ # s.ptp(numeric_only=True)
895
895
896
896
def test_repeat (self ):
897
897
s = Series (np .random .randn (3 ), index = ["a" , "b" , "c" ])
0 commit comments