diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml
index e510f4115b25f..5644ad46714d5 100644
--- a/ci/azure/windows.yml
+++ b/ci/azure/windows.yml
@@ -8,7 +8,7 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
- py37_np16:
+ py37_np17:
ENV_FILE: ci/deps/azure-windows-37.yaml
CONDA_PY: "37"
PATTERN: "not slow and not network"
diff --git a/ci/deps/actions-37-minimum_versions.yaml b/ci/deps/actions-37-minimum_versions.yaml
index e14e51a36be31..8052156858a32 100644
--- a/ci/deps/actions-37-minimum_versions.yaml
+++ b/ci/deps/actions-37-minimum_versions.yaml
@@ -18,7 +18,7 @@ dependencies:
- jinja2=2.10
- numba=0.46.0
- numexpr=2.6.8
- - numpy=1.16.5
+ - numpy=1.17.3
- openpyxl=3.0.0
- pytables=3.5.1
- python-dateutil=2.7.3
diff --git a/ci/deps/azure-macos-37.yaml b/ci/deps/azure-macos-37.yaml
index d667adddda859..8c8b49ff3df5b 100644
--- a/ci/deps/azure-macos-37.yaml
+++ b/ci/deps/azure-macos-37.yaml
@@ -19,7 +19,7 @@ dependencies:
- matplotlib=2.2.3
- nomkl
- numexpr
- - numpy=1.16.5
+ - numpy=1.17.3
- openpyxl
- pyarrow=0.15.1
- pytables
diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml
index e7ac4c783b855..c9d22ffbead45 100644
--- a/ci/deps/azure-windows-37.yaml
+++ b/ci/deps/azure-windows-37.yaml
@@ -24,7 +24,7 @@ dependencies:
- moto>=1.3.14
- flask
- numexpr
- - numpy=1.16.*
+ - numpy=1.17.*
- openpyxl
- pyarrow=0.15
- pytables
diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst
index f56391ab568ac..b6351ac2232ff 100644
--- a/doc/source/getting_started/install.rst
+++ b/doc/source/getting_started/install.rst
@@ -222,7 +222,7 @@ Dependencies
Package Minimum supported version
================================================================ ==========================
`setuptools `__ 38.6.0
-`NumPy `__ 1.16.5
+`NumPy `__ 1.17.3
`python-dateutil `__ 2.7.3
`pytz `__ 2017.3
================================================================ ==========================
diff --git a/doc/source/whatsnew/v1.3.0.rst b/doc/source/whatsnew/v1.3.0.rst
index f132cdf6bbf6e..a21ba2e6c755b 100644
--- a/doc/source/whatsnew/v1.3.0.rst
+++ b/doc/source/whatsnew/v1.3.0.rst
@@ -468,7 +468,7 @@ If installed, we now require:
+-----------------+-----------------+----------+---------+
| Package | Minimum Version | Required | Changed |
+=================+=================+==========+=========+
-| numpy | 1.16.5 | X | |
+| numpy | 1.17.3 | X | X |
+-----------------+-----------------+----------+---------+
| pytz | 2017.3 | X | |
+-----------------+-----------------+----------+---------+
diff --git a/environment.yml b/environment.yml
index 2849297abf3ac..90a9186aa017f 100644
--- a/environment.yml
+++ b/environment.yml
@@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
# required
- - numpy>=1.16.5
+ - numpy>=1.17.3
- python=3
- python-dateutil>=2.7.3
- pytz
diff --git a/pandas/__init__.py b/pandas/__init__.py
index 7cad3eded0585..db4043686bcbb 100644
--- a/pandas/__init__.py
+++ b/pandas/__init__.py
@@ -20,7 +20,6 @@
# numpy compat
from pandas.compat import (
- np_version_under1p17 as _np_version_under1p17,
np_version_under1p18 as _np_version_under1p18,
is_numpy_dev as _is_numpy_dev,
)
diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py
index eb6cf4f9d7d85..cddab28476ae2 100644
--- a/pandas/compat/__init__.py
+++ b/pandas/compat/__init__.py
@@ -16,7 +16,6 @@
is_numpy_dev,
np_array_datetime64_compat,
np_datetime64_compat,
- np_version_under1p17,
np_version_under1p18,
np_version_under1p19,
np_version_under1p20,
@@ -133,7 +132,6 @@ def get_lzma_file(lzma):
"is_numpy_dev",
"np_array_datetime64_compat",
"np_datetime64_compat",
- "np_version_under1p17",
"np_version_under1p18",
"np_version_under1p19",
"np_version_under1p20",
diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py
index 03fb6a68bf2f2..4812a0ecba919 100644
--- a/pandas/compat/numpy/__init__.py
+++ b/pandas/compat/numpy/__init__.py
@@ -8,12 +8,11 @@
# numpy versioning
_np_version = np.__version__
_nlv = LooseVersion(_np_version)
-np_version_under1p17 = _nlv < LooseVersion("1.17")
np_version_under1p18 = _nlv < LooseVersion("1.18")
np_version_under1p19 = _nlv < LooseVersion("1.19")
np_version_under1p20 = _nlv < LooseVersion("1.20")
is_numpy_dev = ".dev" in str(_nlv)
-_min_numpy_ver = "1.16.5"
+_min_numpy_ver = "1.17.3"
if _nlv < _min_numpy_ver:
@@ -65,6 +64,5 @@ def np_array_datetime64_compat(arr, dtype="M8[ns]"):
__all__ = [
"np",
"_np_version",
- "np_version_under1p17",
"is_numpy_dev",
]
diff --git a/pandas/core/array_algos/masked_reductions.py b/pandas/core/array_algos/masked_reductions.py
index 553cdc557ec95..01bb3d50c0da7 100644
--- a/pandas/core/array_algos/masked_reductions.py
+++ b/pandas/core/array_algos/masked_reductions.py
@@ -8,7 +8,6 @@
import numpy as np
from pandas._libs import missing as libmissing
-from pandas.compat import np_version_under1p17
from pandas.core.nanops import check_below_min_count
@@ -46,11 +45,7 @@ def _sumprod(
else:
if check_below_min_count(values.shape, mask, min_count):
return libmissing.NA
-
- if np_version_under1p17:
- return func(values[~mask])
- else:
- return func(values, where=~mask)
+ return func(values, where=~mask)
def sum(
diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py
index 11bb554a0dc5a..ee90dfa3e9a52 100644
--- a/pandas/tests/api/test_api.py
+++ b/pandas/tests/api/test_api.py
@@ -192,7 +192,6 @@ class TestPDApi(Base):
"_hashtable",
"_lib",
"_libs",
- "_np_version_under1p17",
"_np_version_under1p18",
"_is_numpy_dev",
"_testing",
diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py
index f6cd534491544..eb2ed2c25d27c 100644
--- a/pandas/tests/computation/test_eval.py
+++ b/pandas/tests/computation/test_eval.py
@@ -12,10 +12,6 @@
import numpy as np
import pytest
-from pandas.compat import (
- is_platform_windows,
- np_version_under1p17,
-)
from pandas.errors import PerformanceWarning
import pandas.util._test_decorators as td
@@ -220,22 +216,6 @@ def test_simple_cmp_ops(self, cmp_op):
@pytest.mark.parametrize("op", _good_arith_ops)
def test_binary_arith_ops(self, op, lhs, rhs, request):
-
- if (
- op == "/"
- and isinstance(lhs, DataFrame)
- and isinstance(rhs, DataFrame)
- and not lhs.isna().any().any()
- and rhs.shape == (10, 5)
- and np_version_under1p17
- and is_platform_windows()
- and compat.PY38
- ):
- mark = pytest.mark.xfail(
- reason="GH#37328 floating point precision on Windows builds"
- )
- request.node.add_marker(mark)
-
self.check_binary_arith_op(lhs, op, rhs)
def test_modulus(self, lhs, rhs):
diff --git a/pandas/tests/extension/base/dim2.py b/pandas/tests/extension/base/dim2.py
index f9d69e8413cc7..d826a3c30bcc7 100644
--- a/pandas/tests/extension/base/dim2.py
+++ b/pandas/tests/extension/base/dim2.py
@@ -4,26 +4,10 @@
import numpy as np
import pytest
-from pandas.compat import np_version_under1p17
-
import pandas as pd
-from pandas.core.arrays import (
- FloatingArray,
- IntegerArray,
-)
from pandas.tests.extension.base.base import BaseExtensionTests
-def maybe_xfail_masked_reductions(arr, request):
- if (
- isinstance(arr, (FloatingArray, IntegerArray))
- and np_version_under1p17
- and arr.ndim == 2
- ):
- mark = pytest.mark.xfail(reason="masked_reductions does not implement")
- request.node.add_marker(mark)
-
-
class Dim2CompatTests(BaseExtensionTests):
def test_swapaxes(self, data):
arr2d = data.repeat(2).reshape(-1, 2)
@@ -148,7 +132,6 @@ def test_reductions_2d_axis_none(self, data, method, request):
pytest.skip("test is not applicable for this type/dtype")
arr2d = data.reshape(1, -1)
- maybe_xfail_masked_reductions(arr2d, request)
err_expected = None
err_result = None
@@ -177,7 +160,6 @@ def test_reductions_2d_axis0(self, data, method, request):
pytest.skip("test is not applicable for this type/dtype")
arr2d = data.reshape(1, -1)
- maybe_xfail_masked_reductions(arr2d, request)
kwargs = {}
if method == "std":
@@ -225,7 +207,6 @@ def test_reductions_2d_axis1(self, data, method, request):
pytest.skip("test is not applicable for this type/dtype")
arr2d = data.reshape(1, -1)
- maybe_xfail_masked_reductions(arr2d, request)
try:
result = getattr(arr2d, method)(axis=1)
diff --git a/pandas/tests/frame/methods/test_sample.py b/pandas/tests/frame/methods/test_sample.py
index f11e13ca2574e..55ef665c55241 100644
--- a/pandas/tests/frame/methods/test_sample.py
+++ b/pandas/tests/frame/methods/test_sample.py
@@ -1,7 +1,7 @@
import numpy as np
import pytest
-from pandas.compat import np_version_under1p17
+from pandas.compat import np_version_under1p18
from pandas import (
DataFrame,
@@ -158,12 +158,12 @@ def test_sample_none_weights(self, obj):
pytest.param(
"np.random.MT19937",
3,
- marks=pytest.mark.skipif(np_version_under1p17, reason="NumPy<1.17"),
+ marks=pytest.mark.skipif(np_version_under1p18, reason="NumPy<1.18"),
),
pytest.param(
"np.random.PCG64",
11,
- marks=pytest.mark.skipif(np_version_under1p17, reason="NumPy<1.17"),
+ marks=pytest.mark.skipif(np_version_under1p18, reason="NumPy<1.18"),
),
],
)
diff --git a/pandas/tests/indexes/multi/test_analytics.py b/pandas/tests/indexes/multi/test_analytics.py
index 83515d7fb82b1..fa9cdeafff4b4 100644
--- a/pandas/tests/indexes/multi/test_analytics.py
+++ b/pandas/tests/indexes/multi/test_analytics.py
@@ -1,8 +1,6 @@
import numpy as np
import pytest
-from pandas.compat import np_version_under1p17
-
import pandas as pd
from pandas import (
Index,
@@ -246,15 +244,11 @@ def test_numpy_ufuncs(idx, func):
# test ufuncs of numpy. see:
# https://numpy.org/doc/stable/reference/ufuncs.html
- if np_version_under1p17:
- expected_exception = AttributeError
- msg = f"'tuple' object has no attribute '{func.__name__}'"
- else:
- expected_exception = TypeError
- msg = (
- "loop of ufunc does not support argument 0 of type tuple which "
- f"has no callable {func.__name__} method"
- )
+ expected_exception = TypeError
+ msg = (
+ "loop of ufunc does not support argument 0 of type tuple which "
+ f"has no callable {func.__name__} method"
+ )
with pytest.raises(expected_exception, match=msg):
func(idx)
diff --git a/pandas/tests/indexes/test_numpy_compat.py b/pandas/tests/indexes/test_numpy_compat.py
index 59c30c3abac03..f2ed96d0b65b8 100644
--- a/pandas/tests/indexes/test_numpy_compat.py
+++ b/pandas/tests/indexes/test_numpy_compat.py
@@ -1,10 +1,7 @@
import numpy as np
import pytest
-from pandas.compat import (
- np_version_under1p17,
- np_version_under1p18,
-)
+from pandas.compat import np_version_under1p18
from pandas import (
DatetimeIndex,
@@ -81,18 +78,24 @@ def test_numpy_ufuncs_other(index, func, request):
# test ufuncs of numpy, see:
# https://numpy.org/doc/stable/reference/ufuncs.html
if isinstance(index, (DatetimeIndex, TimedeltaIndex)):
- if isinstance(index, DatetimeIndex) and index.tz is not None:
- if func in [np.isfinite, np.isnan, np.isinf]:
- if not np_version_under1p17:
- mark = pytest.mark.xfail(reason="__array_ufunc__ is not defined")
- request.node.add_marker(mark)
+ if (
+ isinstance(index, DatetimeIndex)
+ and index.tz is not None
+ and func in [np.isfinite, np.isnan, np.isinf]
+ and (
+ not np_version_under1p18
+ or (np_version_under1p18 and func is np.isfinite)
+ )
+ ):
+ mark = pytest.mark.xfail(reason="__array_ufunc__ is not defined")
+ request.node.add_marker(mark)
if not np_version_under1p18 and func in [np.isfinite, np.isinf, np.isnan]:
# numpy 1.18(dev) changed isinf and isnan to not raise on dt64/tfd64
result = func(index)
assert isinstance(result, np.ndarray)
- elif not np_version_under1p17 and func in [np.isfinite]:
+ elif func is np.isfinite:
# ok under numpy >= 1.17
# Results in bool array
result = func(index)
diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index 696395e50dd02..229399476773f 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -6,7 +6,7 @@
import numpy as np
import pytest
-from pandas.compat import np_version_under1p17
+from pandas.compat import np_version_under1p18
import pandas as pd
from pandas import Series
@@ -72,7 +72,7 @@ def test_random_state():
# Check BitGenerators
# GH32503
- if not np_version_under1p17:
+ if not np_version_under1p18:
assert (
com.random_state(npr.MT19937(3)).uniform()
== npr.RandomState(npr.MT19937(3)).uniform()
diff --git a/pyproject.toml b/pyproject.toml
index 9f11475234566..3ffda4e2149c0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,8 +5,8 @@ requires = [
"setuptools>=38.6.0",
"wheel",
"Cython>=0.29.21,<3", # Note: sync with setup.py
- "numpy==1.16.5; python_version=='3.7'",
- "numpy==1.17.3; python_version=='3.8'",
+ "numpy==1.17.3; python_version=='3.7'",
+ "numpy==1.18.3; python_version=='3.8'",
"numpy; python_version>='3.9'",
]
# uncomment to enable pep517 after versioneer problem is fixed.
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 966cf50d4fbac..02a4e63374305 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,7 +1,7 @@
# This file is auto-generated from environment.yml, do not modify.
# See that file for comments about the need/usage of each dependency.
-numpy>=1.16.5
+numpy>=1.17.3
python-dateutil>=2.7.3
pytz
asv
diff --git a/setup.cfg b/setup.cfg
index 2aaafa0391531..9e3deff4c7183 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -31,7 +31,7 @@ project_urls =
[options]
packages = find:
install_requires =
- numpy>=1.16.5
+ numpy>=1.17.3
python-dateutil>=2.7.3
pytz>=2017.3
python_requires = >=3.7.1