Skip to content

Commit e39950f

Browse files
authored
Merge branch 'main' into fix-merge-suffixes-61402
2 parents 9a40cd0 + 839747c commit e39950f

28 files changed

+80
-91
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
FROM python:3.10.8
22
WORKDIR /home/pandas
33

4-
RUN apt-get update && apt-get -y upgrade
5-
RUN apt-get install -y build-essential bash-completion
4+
RUN apt-get update && \
5+
apt-get --no-install-recommends -y upgrade && \
6+
apt-get --no-install-recommends -y install \
7+
build-essential \
8+
bash-completion \
9+
# hdf5 needed for pytables installation
10+
libhdf5-dev \
11+
# libgles2-mesa needed for pytest-qt
12+
libgles2-mesa-dev && \
13+
rm -rf /var/lib/apt/lists/*
614

7-
# hdf5 needed for pytables installation
8-
# libgles2-mesa needed for pytest-qt
9-
RUN apt-get install -y libhdf5-dev libgles2-mesa-dev
10-
11-
RUN python -m pip install --upgrade pip
1215
COPY requirements-dev.txt /tmp
13-
RUN python -m pip install -r /tmp/requirements-dev.txt
16+
RUN python -m pip install --no-cache-dir --upgrade pip && \
17+
python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt
1418
RUN git config --global --add safe.directory /home/pandas
1519

1620
ENV SHELL="/bin/bash"

ci/deps/actions-310-minimum_versions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies:
2626

2727
# optional dependencies
2828
- beautifulsoup4=4.12.3
29-
- blosc=1.21.3
3029
- bottleneck=1.3.6
3130
- fastparquet=2024.2.0
3231
- fsspec=2024.2.0

ci/deps/actions-310.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dependencies:
2424

2525
# optional dependencies
2626
- beautifulsoup4>=4.12.3
27-
- blosc>=1.21.3
2827
- bottleneck>=1.3.6
2928
- fastparquet>=2024.2.0
3029
- fsspec>=2024.2.0
@@ -52,7 +51,7 @@ dependencies:
5251
- scipy>=1.12.0
5352
- sqlalchemy>=2.0.0
5453
- tabulate>=0.9.0
55-
- xarray>=2024.1.1, <=2024.9.0
54+
- xarray>=2024.1.1
5655
- xlrd>=2.0.1
5756
- xlsxwriter>=3.2.0
5857
- zstandard>=0.22.0

ci/deps/actions-311-downstream_compat.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ dependencies:
2525

2626
# optional dependencies
2727
- beautifulsoup4>=4.12.3
28-
- blosc>=1.21.3
2928
- bottleneck>=1.3.6
3029
- fastparquet>=2024.2.0
3130
- fsspec>=2024.2.0
@@ -53,7 +52,7 @@ dependencies:
5352
- scipy>=1.12.0
5453
- sqlalchemy>=2.0.0
5554
- tabulate>=0.9.0
56-
- xarray>=2024.1.1, <=2024.9.0
55+
- xarray>=2024.1.1
5756
- xlrd>=2.0.1
5857
- xlsxwriter>=3.2.0
5958
- zstandard>=0.22.0
@@ -63,14 +62,12 @@ dependencies:
6362
- cftime
6463
- dask
6564
- ipython
66-
- geopandas-base
6765
- seaborn
6866
- scikit-learn
6967
- statsmodels
7068
- coverage
7169
- pandas-datareader
7270
- pyyaml
73-
- py
7471
- pip:
7572
- adbc-driver-postgresql>=0.10.0
7673
- adbc-driver-sqlite>=0.8.0

ci/deps/actions-311.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dependencies:
2424

2525
# optional dependencies
2626
- beautifulsoup4>=4.12.3
27-
- blosc>=1.21.3
2827
- bottleneck>=1.3.6
2928
- fastparquet>=2024.2.0
3029
- fsspec>=2024.2.0
@@ -52,7 +51,7 @@ dependencies:
5251
- scipy>=1.12.0
5352
- sqlalchemy>=2.0.0
5453
- tabulate>=0.9.0
55-
- xarray>=2024.1.1, <=2024.9.0
54+
- xarray>=2024.1.1
5655
- xlrd>=2.0.1
5756
- xlsxwriter>=3.2.0
5857
- zstandard>=0.22.0

ci/deps/actions-312.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dependencies:
2424

2525
# optional dependencies
2626
- beautifulsoup4>=4.12.3
27-
- blosc>=1.21.3
2827
- bottleneck>=1.3.6
2928
- fastparquet>=2024.2.0
3029
- fsspec>=2024.2.0
@@ -52,7 +51,7 @@ dependencies:
5251
- scipy>=1.12.0
5352
- sqlalchemy>=2.0.0
5453
- tabulate>=0.9.0
55-
- xarray>=2024.1.1, <=2024.9.0
54+
- xarray>=2024.1.1
5655
- xlrd>=2.0.1
5756
- xlsxwriter>=3.2.0
5857
- zstandard>=0.22.0

ci/deps/actions-313.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies:
5252
- scipy>=1.12.0
5353
- sqlalchemy>=2.0.0
5454
- tabulate>=0.9.0
55-
- xarray>=2024.1.1, <=2024.9.0
55+
- xarray>=2024.1.1
5656
- xlrd>=2.0.1
5757
- xlsxwriter>=3.2.0
5858
- zstandard>=0.22.0

doc/cheatsheet/Pandas_Cheat_Sheet.pdf

63.4 KB
Binary file not shown.
187 KB
Binary file not shown.

doc/cheatsheet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This cheat sheet, originally written by Irv Lustig, [Princeton Consultants](http
1212
| Pandas_Cheat_Sheet_JA | Japanese | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
1313
| Pandas_Cheat_Sheet_FA | Persian | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_FA.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_FA.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
1414

15-
15+
The English version has additional material that is not in the versions in other languages.
1616

1717
**Alternative**
1818

doc/source/getting_started/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ Installable with ``pip install "pandas[hdf5, parquet, feather, spss, excel]"``
305305
Dependency Minimum Version pip extra Notes
306306
====================================================== ================== ================ ==========================================================
307307
`PyTables <https://github.com/PyTables/PyTables>`__ 3.8.0 hdf5 HDF5-based reading / writing
308-
`blosc <https://github.com/Blosc/c-blosc>`__ 1.21.3 hdf5 Compression for HDF5; only available on ``conda``
309308
`zlib <https://github.com/madler/zlib>`__ hdf5 Compression for HDF5
310309
`fastparquet <https://github.com/dask/fastparquet>`__ 2024.2.0 - Parquet reading / writing (pyarrow is default)
311310
`pyarrow <https://github.com/apache/arrow>`__ 10.0.1 parquet, feather Parquet, ORC, and feather reading / writing

doc/source/getting_started/intro_tutorials/includes/titanic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This tutorial uses the Titanic data set, stored as CSV. The data
1111
consists of the following data columns:
1212

1313
- PassengerId: Id of every passenger.
14-
- Survived: Indication whether passenger survived. ``0`` for yes and ``1`` for no.
14+
- Survived: Indication whether passenger survived. ``0`` for no and ``1`` for yes.
1515
- Pclass: One out of the 3 ticket classes: Class ``1``, Class ``2`` and Class ``3``.
1616
- Name: Name of passenger.
1717
- Sex: Gender of passenger.

doc/source/user_guide/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
2626
text, Local clipboard, :ref:`read_clipboard<io.clipboard>`, :ref:`to_clipboard<io.clipboard>`
2727
binary,`MS Excel <https://en.wikipedia.org/wiki/Microsoft_Excel>`__ , :ref:`read_excel<io.excel_reader>`, :ref:`to_excel<io.excel_writer>`
2828
binary,`OpenDocument <http://opendocumentformat.org>`__, :ref:`read_excel<io.ods>`, NA
29-
binary,`HDF5 Format <https://support.hdfgroup.org/HDF5/whatishdf5.html>`__, :ref:`read_hdf<io.hdf5>`, :ref:`to_hdf<io.hdf5>`
29+
binary,`HDF5 Format <https://support.hdfgroup.org/documentation/hdf5/latest/_intro_h_d_f5.html>`__, :ref:`read_hdf<io.hdf5>`, :ref:`to_hdf<io.hdf5>`
3030
binary,`Feather Format <https://github.com/wesm/feather>`__, :ref:`read_feather<io.feather>`, :ref:`to_feather<io.feather>`
3131
binary,`Parquet Format <https://parquet.apache.org/>`__, :ref:`read_parquet<io.parquet>`, :ref:`to_parquet<io.parquet>`
3232
binary,`ORC Format <https://orc.apache.org/>`__, :ref:`read_orc<io.orc>`, :ref:`to_orc<io.orc>`

environment.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727

2828
# optional dependencies
2929
- beautifulsoup4>=4.12.3
30-
- blosc
3130
- bottleneck>=1.3.6
3231
- fastparquet>=2024.2.0
3332
- fsspec>=2024.2.0
@@ -55,7 +54,7 @@ dependencies:
5554
- scipy>=1.12.0
5655
- sqlalchemy>=2.0.0
5756
- tabulate>=0.9.0
58-
- xarray>=2024.1.1, <=2024.9.0
57+
- xarray>=2024.1.1
5958
- xlrd>=2.0.1
6059
- xlsxwriter>=3.2.0
6160
- zstandard>=0.22.0
@@ -83,8 +82,6 @@ dependencies:
8382

8483
# documentation
8584
- gitpython # obtain contributors from git for whatsnew
86-
- gitdb
87-
- google-auth
8885
- natsort # DataFrame.sort_values doctest
8986
- numpydoc
9087
- pydata-sphinx-theme=0.16

pandas/compat/_optional.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"adbc-driver-postgresql": "0.10.0",
2424
"adbc-driver-sqlite": "0.8.0",
2525
"bs4": "4.12.3",
26-
"blosc": "1.21.3",
2726
"bottleneck": "1.3.6",
2827
"fastparquet": "2024.2.0",
2928
"fsspec": "2024.2.0",

pandas/core/arrays/string_.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ class StringDtype(StorageExtensionDtype):
123123
Examples
124124
--------
125125
>>> pd.StringDtype()
126-
string[python]
126+
<StringDtype(storage='python', na_value=<NA>)>
127127
128128
>>> pd.StringDtype(storage="pyarrow")
129-
string[pyarrow]
129+
<StringDtype(na_value=<NA>)>
130130
"""
131131

132132
@property
@@ -198,11 +198,8 @@ def __init__(
198198
self._na_value = na_value
199199

200200
def __repr__(self) -> str:
201-
if self._na_value is libmissing.NA:
202-
return f"{self.name}[{self.storage}]"
203-
else:
204-
# TODO add more informative repr
205-
return self.name
201+
storage = "" if self.storage == "pyarrow" else "storage='python', "
202+
return f"<StringDtype({storage}na_value={self._na_value})>"
206203

207204
def __eq__(self, other: object) -> bool:
208205
# we need to override the base class __eq__ because na_value (NA or NaN)

pandas/core/generic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,7 +3964,7 @@ def take(self, indices, axis: Axis = 0, **kwargs) -> Self:
39643964
----------
39653965
indices : array-like
39663966
An array of ints indicating which positions to take.
3967-
axis : {0 or 'index', 1 or 'columns', None}, default 0
3967+
axis : {0 or 'index', 1 or 'columns'}, default 0
39683968
The axis on which to select elements. ``0`` means that we are
39693969
selecting rows, ``1`` means that we are selecting columns.
39703970
For `Series` this parameter is unused and defaults to 0.
@@ -6819,12 +6819,12 @@ def convert_dtypes(
68196819
2 3 z <NA> <NA> 20 200.0
68206820
68216821
>>> dfn.dtypes
6822-
a Int32
6823-
b string[python]
6824-
c boolean
6825-
d string[python]
6826-
e Int64
6827-
f Float64
6822+
a Int32
6823+
b string
6824+
c boolean
6825+
d string
6826+
e Int64
6827+
f Float64
68286828
dtype: object
68296829
68306830
Start with a Series of strings and missing data represented by ``np.nan``.

pandas/io/formats/format.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
ExtensionArray,
6868
TimedeltaArray,
6969
)
70-
from pandas.core.arrays.string_ import StringDtype
7170
from pandas.core.base import PandasObject
7271
import pandas.core.common as com
7372
from pandas.core.indexes.api import (
@@ -1218,8 +1217,6 @@ def _format(x):
12181217
return self.na_rep
12191218
elif isinstance(x, PandasObject):
12201219
return str(x)
1221-
elif isinstance(x, StringDtype):
1222-
return repr(x)
12231220
else:
12241221
# object dtype
12251222
return str(formatter(x))

pandas/tests/arrays/string_/test_string.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ def test_repr(dtype):
103103
assert repr(df.A.array) == expected
104104

105105

106+
def test_dtype_repr(dtype):
107+
if dtype.storage == "pyarrow":
108+
if dtype.na_value is pd.NA:
109+
assert repr(dtype) == "<StringDtype(na_value=<NA>)>"
110+
else:
111+
assert repr(dtype) == "<StringDtype(na_value=nan)>"
112+
elif dtype.na_value is pd.NA:
113+
assert repr(dtype) == "<StringDtype(storage='python', na_value=<NA>)>"
114+
else:
115+
assert repr(dtype) == "<StringDtype(storage='python', na_value=nan)>"
116+
117+
106118
def test_none_to_nan(cls, dtype):
107119
a = cls._from_sequence(["a", None, "b"], dtype=dtype)
108120
assert a[1] is not None

0 commit comments

Comments
 (0)