Skip to content

Commit

Permalink
Merge pull request #8483 from jreback/value_range
Browse files Browse the repository at this point in the history
DEPR: deprecate value_range (GH8481)
  • Loading branch information
jreback committed Oct 6, 2014
2 parents 9b024b5 + 45be995 commit 3d5d446
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 44 deletions.
3 changes: 0 additions & 3 deletions doc/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@ arguments. The special value ``all`` can also be used:
That feature relies on :ref:`select_dtypes <basics.selectdtypes>`. Refer to there for details about accepted inputs.

There also is a utility function, ``value_range`` which takes a DataFrame and
returns a series with the minimum/maximum values in the DataFrame.

.. _basics.idxmin:

Index of Min/Max Values
Expand Down
1 change: 1 addition & 0 deletions doc/source/v0.15.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ Deprecations
``ambiguous`` to allow for more flexibility in dealing with DST transitions.
Replace ``infer_dst=True`` with ``ambiguous='infer'`` for the same behavior (:issue:`7943`).
See :ref:`the docs<timeseries.timezone_ambiguous>` for more details.
- The top-level ``pd.value_range`` has been deprecated and can be replaced by ``.describe()`` (:issue:`8481`)

.. _whatsnew_0150.index_set_ops:

Expand Down
4 changes: 3 additions & 1 deletion pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@
from pandas.io.api import *
from pandas.computation.api import *

from pandas.tools.describe import value_range
from pandas.tools.merge import merge, concat, ordered_merge
from pandas.tools.pivot import pivot_table, crosstab
from pandas.tools.plotting import scatter_matrix, plot_params
from pandas.tools.tile import cut, qcut
from pandas.tools.util import value_range
from pandas.core.reshape import melt
from pandas.util.print_versions import show_versions
import pandas.util.testing


17 changes: 0 additions & 17 deletions pandas/tools/describe.py

This file was deleted.

23 changes: 0 additions & 23 deletions pandas/tools/tests/test_tools.py

This file was deleted.

20 changes: 20 additions & 0 deletions pandas/tools/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import operator
import warnings
from pandas.compat import reduce
from pandas.core.index import Index
import numpy as np
Expand Down Expand Up @@ -47,3 +48,22 @@ def compose(*funcs):
"""Compose 2 or more callables"""
assert len(funcs) > 1, 'At least 2 callables must be passed to compose'
return reduce(_compose2, funcs)

### FIXME: remove in 0.16
def value_range(df):
"""
Return the minimum and maximum of a dataframe in a series object
Parameters
----------
df : DataFrame
Returns
-------
(maximum, minimum) : Series
"""
from pandas import Series
warnings.warn("value_range is deprecated. Use .describe() instead", FutureWarning)

return Series((min(df.min()), max(df.max())), ('Minimum', 'Maximum'))

0 comments on commit 3d5d446

Please sign in to comment.