Skip to content

Commit 08a5f3e

Browse files
committed
remove comments)
1 parent d9e955e commit 08a5f3e

File tree

3 files changed

+1
-71
lines changed

3 files changed

+1
-71
lines changed

pandas/core/generic.py

-37
Original file line numberDiff line numberDiff line change
@@ -10184,43 +10184,6 @@ def mad(self, axis=None, skipna=None, level=None):
1018410184
_min_examples,
1018510185
)
1018610186

10187-
# @classmethod
10188-
# def _add_series_only_operations(cls):
10189-
# """
10190-
# Add the series only operations to the cls; evaluate the doc
10191-
# strings again.
10192-
# """
10193-
10194-
# axis_descr, name, name2 = _doc_parms(cls)
10195-
10196-
# def nanptp(values, axis=0, skipna=True):
10197-
# nmax = nanops.nanmax(values, axis, skipna)
10198-
# nmin = nanops.nanmin(values, axis, skipna)
10199-
# warnings.warn(
10200-
# "Method .ptp is deprecated and will be removed "
10201-
# "in a future version. Use numpy.ptp instead."
10202-
# "if you are already using numpy.ptp and still getting this message,"
10203-
# "please call to_numpy() to avoid this message in future calls."
10204-
# "For example: np.ptp(pd.Series([1, 2, 3]).to_numpy())",
10205-
# FutureWarning,
10206-
# stacklevel=4,
10207-
# )
10208-
# return nmax - nmin
10209-
10210-
# cls.ptp = _make_stat_function(
10211-
# cls,
10212-
# "ptp",
10213-
# name,
10214-
# name2,
10215-
# axis_descr,
10216-
# """Return the difference between the min and max value.
10217-
# \n.. deprecated:: 0.24.0 Use numpy.ptp instead
10218-
# \nReturn the difference between the maximum value and the
10219-
# minimum value in the object. This is the equivalent of the
10220-
# ``numpy.ndarray`` method ``ptp``.""",
10221-
# nanptp,
10222-
# )
10223-
1022410187
@classmethod
1022510188
def _add_series_or_dataframe_operations(cls):
1022610189
"""

pandas/core/series.py

-1
Original file line numberDiff line numberDiff line change
@@ -4390,7 +4390,6 @@ def to_period(self, freq=None, copy=True):
43904390
["index"], docs={"index": "The index (axis labels) of the Series."},
43914391
)
43924392
Series._add_numeric_operations()
4393-
# Series._add_series_only_operations()
43944393
Series._add_series_or_dataframe_operations()
43954394

43964395
# Add arithmetic!

pandas/tests/series/test_analytics.py

+1-33
Original file line numberDiff line numberDiff line change
@@ -858,41 +858,9 @@ def test_ptp(self):
858858
arr = np.random.randn(N)
859859
ser = Series(arr)
860860
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
861+
print("hell")
861862
assert np.ptp(ser) == np.ptp(arr)
862863

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)
895-
896864
def test_repeat(self):
897865
s = Series(np.random.randn(3), index=["a", "b", "c"])
898866

0 commit comments

Comments
 (0)