1
0
forked from pool/python-pandas

Accepting request 1063914 from home:apersaud:branches:devel:languages:python:numeric

update to latest version

OBS-URL: https://build.opensuse.org/request/show/1063914
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pandas?expand=0&rev=80
This commit is contained in:
Matej Cepl 2023-02-11 15:53:21 +00:00 committed by Git OBS Bridge
parent 04666fb180
commit cac58a923c
5 changed files with 97 additions and 167 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:220b98d15cee0b2cd839a6358bd1f273d0356bf964c1a1aeb32d47db0215488b
size 5201551

BIN
pandas-1.5.3.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,125 +0,0 @@
From a0e1b0c28dfccd9a3f9e9e2794ef109e950d1a08 Mon Sep 17 00:00:00 2001
From: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
Date: Thu, 24 Nov 2022 11:58:42 +0000
Subject: [PATCH] Backport PR #49886: CI: Remove deprecated numpy dtype aliases
---
asv_bench/benchmarks/sparse.py | 4 ++--
pandas/core/arrays/sparse/array.py | 4 ++--
pandas/core/interchange/column.py | 2 +-
pandas/tests/arrays/sparse/test_indexing.py | 4 ++--
pandas/tests/arrays/sparse/test_reductions.py | 2 +-
pandas/tests/arrays/sparse/test_unary.py | 4 ++--
pandas/tests/io/excel/test_writers.py | 9 ++++-----
7 files changed, 14 insertions(+), 15 deletions(-)
Index: pandas-1.5.2/pandas/core/arrays/sparse/array.py
===================================================================
--- pandas-1.5.2.orig/pandas/core/arrays/sparse/array.py
+++ pandas-1.5.2/pandas/core/arrays/sparse/array.py
@@ -728,7 +728,7 @@ class SparseArray(OpsMixin, PandasObject
dtype = SparseDtype(bool, self._null_fill_value)
if self._null_fill_value:
return type(self)._simple_new(isna(self.sp_values), self.sp_index, dtype)
- mask = np.full(len(self), False, dtype=np.bool8)
+ mask = np.full(len(self), False, dtype=np.bool_)
mask[self.sp_index.indices] = isna(self.sp_values)
return type(self)(mask, fill_value=False, dtype=dtype)
@@ -1043,7 +1043,7 @@ class SparseArray(OpsMixin, PandasObject
if not key.fill_value:
return self.take(key.sp_index.indices)
n = len(self)
- mask = np.full(n, True, dtype=np.bool8)
+ mask = np.full(n, True, dtype=np.bool_)
mask[key.sp_index.indices] = False
return self.take(np.arange(n)[mask])
else:
Index: pandas-1.5.2/pandas/core/interchange/column.py
===================================================================
--- pandas-1.5.2.orig/pandas/core/interchange/column.py
+++ pandas-1.5.2/pandas/core/interchange/column.py
@@ -315,7 +315,7 @@ class PandasColumn(Column):
valid = invalid == 0
invalid = not valid
- mask = np.zeros(shape=(len(buf),), dtype=np.bool8)
+ mask = np.zeros(shape=(len(buf),), dtype=np.bool_)
for i, obj in enumerate(buf):
mask[i] = valid if isinstance(obj, str) else invalid
Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_indexing.py
===================================================================
--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_indexing.py
+++ pandas-1.5.2/pandas/tests/arrays/sparse/test_indexing.py
@@ -85,7 +85,7 @@ class TestGetitem:
def test_getitem_bool_sparse_array(self):
# GH 23122
- spar_bool = SparseArray([False, True] * 5, dtype=np.bool8, fill_value=True)
+ spar_bool = SparseArray([False, True] * 5, dtype=np.bool_, fill_value=True)
exp = SparseArray([np.nan, 2, np.nan, 5, 6])
tm.assert_sp_array_equal(arr[spar_bool], exp)
@@ -95,7 +95,7 @@ class TestGetitem:
tm.assert_sp_array_equal(res, exp)
spar_bool = SparseArray(
- [False, True, np.nan] * 3, dtype=np.bool8, fill_value=np.nan
+ [False, True, np.nan] * 3, dtype=np.bool_, fill_value=np.nan
)
res = arr[spar_bool]
exp = SparseArray([np.nan, 3, 5])
Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_reductions.py
===================================================================
--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_reductions.py
+++ pandas-1.5.2/pandas/tests/arrays/sparse/test_reductions.py
@@ -142,7 +142,7 @@ class TestReductions:
assert result == expected
def test_bool_sum_min_count(self):
- spar_bool = SparseArray([False, True] * 5, dtype=np.bool8, fill_value=True)
+ spar_bool = SparseArray([False, True] * 5, dtype=np.bool_, fill_value=True)
res = spar_bool.sum(min_count=1)
assert res == 5
res = spar_bool.sum(min_count=11)
Index: pandas-1.5.2/pandas/tests/arrays/sparse/test_unary.py
===================================================================
--- pandas-1.5.2.orig/pandas/tests/arrays/sparse/test_unary.py
+++ pandas-1.5.2/pandas/tests/arrays/sparse/test_unary.py
@@ -59,9 +59,9 @@ class TestUnaryMethods:
tm.assert_sp_array_equal(exp, res)
def test_invert_operator(self):
- arr = SparseArray([False, True, False, True], fill_value=False, dtype=np.bool8)
+ arr = SparseArray([False, True, False, True], fill_value=False, dtype=np.bool_)
exp = SparseArray(
- np.invert([False, True, False, True]), fill_value=True, dtype=np.bool8
+ np.invert([False, True, False, True]), fill_value=True, dtype=np.bool_
)
res = ~arr
tm.assert_sp_array_equal(exp, res)
Index: pandas-1.5.2/pandas/tests/io/excel/test_writers.py
===================================================================
--- pandas-1.5.2.orig/pandas/tests/io/excel/test_writers.py
+++ pandas-1.5.2/pandas/tests/io/excel/test_writers.py
@@ -496,15 +496,14 @@ class TestExcelWriter:
tm.assert_frame_equal(df, recons)
- @pytest.mark.parametrize("np_type", [np.bool8, np.bool_])
- def test_bool_types(self, np_type, path):
- # Test np.bool8 and np.bool_ values read come back as float.
- df = DataFrame([1, 0, True, False], dtype=np_type)
+ def test_bool_types(self, path):
+ # Test np.bool_ values read come back as float.
+ df = DataFrame([1, 0, True, False], dtype=np.bool_)
df.to_excel(path, "test1")
with ExcelFile(path) as reader:
recons = pd.read_excel(reader, sheet_name="test1", index_col=0).astype(
- np_type
+ np.bool_
)
tm.assert_frame_equal(df, recons)

View File

@ -1,3 +1,61 @@
-------------------------------------------------------------------
Wed Feb 8 18:28:19 UTC 2023 - Arun Persaud <arun@gmx.de>
- specfile:
* update copyright year
* remove pandas-pr49886-fix-numpy-deprecations.patch, implemented upstreams
- update to version 1.5.3:
* Fixed regressions
+ Fixed performance regression in Series.isin() when values is
empty (GH49839)
+ Fixed regression in DataFrame.memory_usage() showing unnecessary
FutureWarning when DataFrame is empty (GH50066)
+ Fixed regression in DataFrameGroupBy.transform() when used with
as_index=False (GH49834)
+ Enforced reversion of color as an alias for c and size as an
alias for s in function DataFrame.plot.scatter() (GH49732)
+ Fixed regression in SeriesGroupBy.apply() setting a name
attribute on the result if the result was a DataFrame (GH49907)
+ Fixed performance regression in setting with the at() indexer
(GH49771)
+ Fixed regression in the methods apply, agg, and transform when
used with NumPy functions that informed users to supply
numeric_only=True if the operation failed on non-numeric dtypes;
such columns must be dropped prior to using these methods
(GH50538)
+ Fixed regression in to_datetime() raising ValueError when
parsing array of float containing np.nan (GH50237)
* Bug fixes
+ Bug in the Copy-on-Write implementation losing track of views
when indexing a DataFrame with another DataFrame (GH50630)
+ Bug in Styler.to_excel() leading to error when unrecognized
border-style (e.g. "hair") provided to Excel writers (GH48649)
+ Bug in Series.quantile() emitting warning from NumPy when Series
has only NA values (GH50681)
+ Bug when chaining several Styler.concat() calls, only the last
styler was concatenated (GH49207)
+ Fixed bug when instantiating a DataFrame subclass inheriting
from typing.Generic that triggered a UserWarning on python 3.11
(GH49649)
+ Bug in pivot_table() with NumPy 1.24 or greater when the
DataFrame columns has nested elements (GH50342)
+ Bug in pandas.testing.assert_series_equal() (and equivalent
assert_ functions) when having nested data and using numpy >=
1.25 (GH50360)
* Other
+ Note: If you are using DataFrame.to_sql(), read_sql(),
read_sql_table(), or read_sql_query() with SQLAlchemy 1.4.46 or
greater, you may see a sqlalchemy.exc.RemovedIn20Warning. These
warnings can be safely ignored for the SQLAlchemy 1.4.x releases
as pandas works toward compatibility with SQLAlchemy 2.0.
+ Reverted deprecation (GH45324) of behavior of
Series.__getitem__() and Series.__setitem__() slicing with an
integer Index; this will remain positional (GH49612)
+ A FutureWarning raised when attempting to set values inplace
with DataFrame.loc() or DataFrame.iloc() has been changed to a
DeprecationWarning (GH48673)
-------------------------------------------------------------------
Fri Dec 23 16:22:18 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -1,7 +1,7 @@
#
# spec file
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -39,9 +39,8 @@
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-pandas%{psuffix}
Version: 1.5.2
Version: 1.5.3
Release: 0
Summary: Python data structures for data analysis, time series, and statistics
License: BSD-3-Clause
@ -49,8 +48,6 @@ Group: Development/Libraries/Python
URL: https://pandas.pydata.org/
Source0: https://files.pythonhosted.org/packages/source/p/pandas/pandas-%{version}.tar.gz
# SourceRepository: https://github.com/pandas-dev/pandas
# PATCH-FIX-UPSTREAM pandas-pr49886-fix-numpy-deprecations.patch gh#pandas-dev/pandas#49886, gh#pandas-dev/pandas#49887
Patch1: pandas-pr49886-fix-numpy-deprecations.patch
BuildRequires: %{python_module Cython >= 0.29.32}
BuildRequires: %{python_module devel >= 3.8}
BuildRequires: %{python_module numpy-devel >= 1.20.3}
@ -63,56 +60,56 @@ BuildRequires: python-rpm-macros
Requires: python-numpy >= 1.20.3
Requires: python-python-dateutil >= 2.8.1
Requires: python-pytz >= 2020.1
Obsoletes: python-pandas-doc < %{version}
Provides: python-pandas-doc = %{version}
# SECTION Optional dependencies
# https://pandas.pydata.org/docs/getting_started/install.html#optional-dependencies
Recommends: python-Bottleneck >= 1.3.2
Recommends: python-numexpr >= 2.7.3
# Compression
Suggests: python-Brotli >= 0.7.0
Suggests: python-Jinja2 >= 3.0.0
# SQL databases
Suggests: python-PyMySQL >= 1.0.2
Suggests: python-QtPy
Suggests: python-SQLAlchemy >= 1.4.16
Suggests: python-XlsxWriter >= 1.2.2
# HTML
Suggests: python-beautifulsoup4 >= 4.9.3
Suggests: python-blosc >= 1.21.0
Suggests: python-fastparquet >= 0.4.0
# Access data in the cloud
Suggests: python-fsspec >= 2021.7.0
Suggests: python-gcsfs >= 2021.7.0
Suggests: python-html5lib >= 1.1
Suggests: python-lxml >= 4.6.3
# Visualization
Suggests: python-matplotlib >= 3.3.2
Suggests: python-Jinja2 >= 3.0.0
Suggests: python-tabulate >= 0.8.9
Suggests: python-numba >= 0.53.1
Suggests: python-openpyxl >= 3.0.7
Suggests: python-pandas-gbq >= 0.15.0
Suggests: python-psycopg2 >= 2.8.6
Suggests: python-pyarrow >= 1.0.1
Suggests: python-pyreadstat >= 1.1.2
Suggests: python-python-snappy >= 0.6.0
Suggests: python-pyxlb >= 1.0.8
# Clipboard
Suggests: python-qt5
Suggests: python-s3fs >= 2021.08.0
# Computation
Suggests: python-scipy >= 1.7.1
Suggests: python-numba >= 0.53.1
# Other data sources
Suggests: python-tables >= 3.6.1
Suggests: python-tabulate >= 0.8.9
Suggests: python-xarray >= 0.19.0
# Excel files
Suggests: python-xlrd >= 2.0.1
Suggests: python-xlwt >= 1.3.0
Suggests: python-XlsxWriter >= 1.2.2
Suggests: python-openpyxl >= 3.0.7
Suggests: python-pyxlb >= 1.0.8
# HTML
Suggests: python-beautifulsoup4 >= 4.9.3
Suggests: python-html5lib >= 1.1
Suggests: python-lxml >= 4.6.3
# SQL databases
Suggests: python-PyMySQL >= 1.0.2
Suggests: python-SQLAlchemy >= 1.4.16
Suggests: python-psycopg2 >= 2.8.6
# Other data sources
Suggests: python-tables >= 3.6.1
Suggests: python-blosc >= 1.21.0
Suggests: python-zlib
Suggests: python-fastparquet >= 0.4.0
Suggests: python-pyarrow >= 1.0.1
Suggests: python-pyreadstat >= 1.1.2
# Access data in the cloud
Suggests: python-fsspec >= 2021.7.0
Suggests: python-gcsfs >= 2021.7.0
Suggests: python-pandas-gbq >= 0.15.0
Suggests: python-s3fs >= 2021.08.0
# Clipboard
Suggests: python-qt5
Suggests: python-QtPy
Suggests: python-zstandard >= 0.15.2
Suggests: xclip
Suggests: xsel
# Compression
Suggests: python-Brotli >= 0.7.0
Suggests: python-python-snappy >= 0.6.0
Suggests: python-zstandard >= 0.15.2
# /SECTION
Obsoletes: python-pandas-doc < %{version}
Provides: python-pandas-doc = %{version}
%if %{with test}
BuildRequires: %{python_module Bottleneck >= 1.3.2}
BuildRequires: %{python_module Jinja2 >= 3}