Skip to content

Commit

Permalink
CLN: Drop Numpy 1.22 per NEP29 (#56838)
Browse files Browse the repository at this point in the history
  • Loading branch information
lithomas1 committed Jan 18, 2024
1 parent 0b1f141 commit e544b9f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/deps/actions-39-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:

# required dependencies
- python-dateutil=2.8.2
- numpy=1.22.4
- numpy=1.23.5
- pytz=2020.1

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pandas requires the following dependencies.
================================================================ ==========================
Package Minimum supported version
================================================================ ==========================
`NumPy <https://numpy.org>`__ 1.22.4
`NumPy <https://numpy.org>`__ 1.23.5
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.8.2
`pytz <https://pypi.org/project/pytz/>`__ 2020.1
`tzdata <https://pypi.org/project/tzdata/>`__ 2022.7
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v2.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ If installed, we now require:
+-----------------+-----------------+----------+---------+
| Package | Minimum Version | Required | Changed |
+=================+=================+==========+=========+
| | | X | X |
| numpy | 1.23.5 | X | X |
+-----------------+-----------------+----------+---------+

For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
Expand Down
3 changes: 1 addition & 2 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
# numpy versioning
_np_version = np.__version__
_nlv = Version(_np_version)
np_version_lt1p23 = _nlv < Version("1.23")
np_version_gte1p24 = _nlv >= Version("1.24")
np_version_gte1p24p3 = _nlv >= Version("1.24.3")
np_version_gte1p25 = _nlv >= Version("1.25")
np_version_gt2 = _nlv >= Version("2.0.0.dev0")
is_numpy_dev = _nlv.dev is not None
_min_numpy_ver = "1.22.4"
_min_numpy_ver = "1.23.5"


if _nlv < Version(_min_numpy_ver):
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/interchange/test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
is_ci_environment,
is_platform_windows,
)
from pandas.compat.numpy import np_version_lt1p23

import pandas as pd
import pandas._testing as tm
Expand Down Expand Up @@ -260,7 +259,6 @@ def test_datetime():
tm.assert_frame_equal(df, from_dataframe(df.__dataframe__()))


@pytest.mark.skipif(np_version_lt1p23, reason="Numpy > 1.23 required")
def test_categorical_to_numpy_dlpack():
# https://github.com/pandas-dev/pandas/issues/48393
df = pd.DataFrame({"A": pd.Categorical(["a", "b", "a"])})
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ authors = [
license = {file = 'LICENSE'}
requires-python = '>=3.9'
dependencies = [
"numpy>=1.22.4; python_version<'3.11'",
"numpy>=1.23.2; python_version=='3.11'",
"numpy>=1.23.5; python_version<'3.12'",
"numpy>=1.26.0; python_version>='3.12'",
"python-dateutil>=2.8.2",
"pytz>=2020.1",
Expand Down

0 comments on commit e544b9f

Please sign in to comment.