Skip to content

Commit 21fd7c6

Browse files
committed
remove bottleneck < 1.0.0
closes pandas-dev#15214
1 parent d7da7f8 commit 21fd7c6

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

ci/requirements-2.7_COMPAT.run

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pytz=2013b
44
scipy=0.11.0
55
xlwt=0.7.5
66
xlrd=0.9.2
7-
bottleneck=0.8.0
87
numexpr=2.2.2
98
pytables=3.0.0
109
html5lib=1.0b2

ci/requirements-2.7_LOCALE.run

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ xlwt=0.7.5
55
openpyxl=1.6.2
66
xlsxwriter=0.5.2
77
xlrd=0.9.2
8-
bottleneck=0.8.0
98
matplotlib=1.3.1
109
sqlalchemy=0.8.1
1110
html5lib=1.0b2

doc/source/install.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ Recommended Dependencies
217217
If installed, must be Version 2.4.6 or higher.
218218

219219
* `bottleneck <http://berkeleyanalytics.com/bottleneck>`__: for accelerating certain types of ``nan``
220-
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups.
220+
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups. If installed,
221+
must be Version 1.0.0 or higher.
221222

222223
.. note::
223224

doc/source/whatsnew/v0.21.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ Other API Changes
205205
^^^^^^^^^^^^^^^^^
206206

207207
- Support has been dropped for Python 3.4 (:issue:`15251`)
208+
- Support has been dropped for bottleneck < 1.0.0 (:issue:`15214`)
208209
- The Categorical constructor no longer accepts a scalar for the ``categories`` keyword. (:issue:`16022`)
209210
- Accessing a non-existent attribute on a closed :class:`~pandas.HDFStore` will now
210211
raise an ``AttributeError`` rather than a ``ClosedFileError`` (:issue:`16301`)

pandas/core/nanops.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import itertools
22
import functools
33
import operator
4+
import warnings
5+
from distutils.version import LooseVersion
46

57
import numpy as np
68
from pandas import compat
@@ -20,11 +22,24 @@
2022
from pandas.core.config import get_option
2123
from pandas.core.common import _values_from_object
2224

25+
_BOTTLENECK_INSTALLED = False
26+
_MIN_BOTTLENECK_VERSION = '1.0.0'
27+
2328
try:
2429
import bottleneck as bn
25-
_BOTTLENECK_INSTALLED = True
30+
ver = bn.__version__
31+
_BOTTLENCK_INSTALLED = ver >= LooseVersion(_MIN_BOTTLENECK_VERSION)
32+
33+
if not _BOTTLENECK_INSTALLED:
34+
warnings.warn(
35+
"The installed version of bottleneck {ver} is not supported "
36+
"in pandas and will be not be used\nThe minimum supported "
37+
"version is {min_ver}\n".format(
38+
ver=ver, min_ver=_MIN_BOTTLENECK_VERSION), UserWarning)
39+
2640
except ImportError: # pragma: no cover
27-
_BOTTLENECK_INSTALLED = False
41+
pass
42+
2843

2944
_USE_BOTTLENECK = False
3045

0 commit comments

Comments
 (0)