Skip to content

Commit 45be995

Browse files
committed
DEPR: deprecate value_range (GH8481)
1 parent 6d3803d commit 45be995

File tree

6 files changed

+24
-44
lines changed

6 files changed

+24
-44
lines changed

doc/source/basics.rst

-3
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,6 @@ arguments. The special value ``all`` can also be used:
509509
510510
That feature relies on :ref:`select_dtypes <basics.selectdtypes>`. Refer to there for details about accepted inputs.
511511

512-
There also is a utility function, ``value_range`` which takes a DataFrame and
513-
returns a series with the minimum/maximum values in the DataFrame.
514-
515512
.. _basics.idxmin:
516513

517514
Index of Min/Max Values

doc/source/v0.15.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ Deprecations
772772
``ambiguous`` to allow for more flexibility in dealing with DST transitions.
773773
Replace ``infer_dst=True`` with ``ambiguous='infer'`` for the same behavior (:issue:`7943`).
774774
See :ref:`the docs<timeseries.timezone_ambiguous>` for more details.
775+
- The top-level ``pd.value_range`` has been deprecated and can be replaced by ``.describe()`` (:issue:`8481`)
775776

776777
.. _whatsnew_0150.index_set_ops:
777778

pandas/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
from pandas.io.api import *
5454
from pandas.computation.api import *
5555

56-
from pandas.tools.describe import value_range
5756
from pandas.tools.merge import merge, concat, ordered_merge
5857
from pandas.tools.pivot import pivot_table, crosstab
5958
from pandas.tools.plotting import scatter_matrix, plot_params
6059
from pandas.tools.tile import cut, qcut
60+
from pandas.tools.util import value_range
6161
from pandas.core.reshape import melt
6262
from pandas.util.print_versions import show_versions
6363
import pandas.util.testing
64+
65+

pandas/tools/describe.py

-17
This file was deleted.

pandas/tools/tests/test_tools.py

-23
This file was deleted.

pandas/tools/util.py

+20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import operator
2+
import warnings
23
from pandas.compat import reduce
34
from pandas.core.index import Index
45
import numpy as np
@@ -47,3 +48,22 @@ def compose(*funcs):
4748
"""Compose 2 or more callables"""
4849
assert len(funcs) > 1, 'At least 2 callables must be passed to compose'
4950
return reduce(_compose2, funcs)
51+
52+
### FIXME: remove in 0.16
53+
def value_range(df):
54+
"""
55+
Return the minimum and maximum of a dataframe in a series object
56+
57+
Parameters
58+
----------
59+
df : DataFrame
60+
61+
Returns
62+
-------
63+
(maximum, minimum) : Series
64+
65+
"""
66+
from pandas import Series
67+
warnings.warn("value_range is deprecated. Use .describe() instead", FutureWarning)
68+
69+
return Series((min(df.min()), max(df.max())), ('Minimum', 'Maximum'))

0 commit comments

Comments
 (0)