Skip to content

Commit a6570a3

Browse files
committed
Merge branch 'main' into enh-stata-non-nano
2 parents ce74709 + 33ff3d9 commit a6570a3

File tree

187 files changed

+2908
-1723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+2908
-1723
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
.mesonpy-native-file.ini
4040
MANIFEST
4141
compile_commands.json
42+
debug
4243
.debug
4344

4445
# Python files #
@@ -104,10 +105,11 @@ scikits
104105
# Generated Sources #
105106
#####################
106107
!skts.c
107-
!np_datetime.c
108-
!np_datetime_strings.c
109108
*.c
110109
*.cpp
110+
!pandas/_libs/src/**/*.c
111+
!pandas/_libs/src/**/*.h
112+
!pandas/_libs/include/**/*.h
111113

112114
# Unit / Performance Testing #
113115
##############################

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ci:
2020
repos:
2121
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
2222
# black compiled with mypyc
23-
rev: 23.10.1
23+
rev: 23.11.0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.1.4
27+
rev: v0.1.6
2828
hooks:
2929
- id: ruff
3030
args: [--exit-non-zero-on-fix]
@@ -47,7 +47,7 @@ repos:
4747
types_or: [python, rst, markdown, cython, c]
4848
additional_dependencies: [tomli]
4949
- repo: https://github.com/MarcoGorelli/cython-lint
50-
rev: v0.15.0
50+
rev: v0.16.0
5151
hooks:
5252
- id: cython-lint
5353
- id: double-quote-cython-strings
@@ -111,11 +111,11 @@ repos:
111111
types: [text] # overwrite types: [rst]
112112
types_or: [python, rst]
113113
- repo: https://github.com/sphinx-contrib/sphinx-lint
114-
rev: v0.8.1
114+
rev: v0.9.0
115115
hooks:
116116
- id: sphinx-lint
117117
- repo: https://github.com/pre-commit/mirrors-clang-format
118-
rev: v17.0.4
118+
rev: v17.0.6
119119
hooks:
120120
- id: clang-format
121121
files: ^pandas/_libs/src|^pandas/_libs/include

ci/deps/actions-310.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
- pyqt>=5.15.9
4747
- pyreadstat>=1.2.0
4848
- pytables>=3.8.0
49-
- python-calamine>=0.1.6
49+
- python-calamine>=0.1.7
5050
- pyxlsb>=1.0.10
5151
- s3fs>=2022.11.0
5252
- scipy>=1.10.0

ci/deps/actions-311-downstream_compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies:
4747
- pyqt>=5.15.9
4848
- pyreadstat>=1.2.0
4949
- pytables>=3.8.0
50-
- python-calamine>=0.1.6
50+
- python-calamine>=0.1.7
5151
- pyxlsb>=1.0.10
5252
- s3fs>=2022.11.0
5353
- scipy>=1.10.0

ci/deps/actions-311.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
- pymysql>=1.0.2
4747
- pyreadstat>=1.2.0
4848
- pytables>=3.8.0
49-
- python-calamine>=0.1.6
49+
- python-calamine>=0.1.7
5050
- pyxlsb>=1.0.10
5151
- s3fs>=2022.11.0
5252
- scipy>=1.10.0

ci/deps/actions-312.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
- pymysql>=1.0.2
4747
- pyreadstat>=1.2.0
4848
# - pytables>=3.8.0
49-
# - python-calamine>=0.1.6
49+
- python-calamine>=0.1.7
5050
- pyxlsb>=1.0.10
5151
- s3fs>=2022.11.0
5252
- scipy>=1.10.0

ci/deps/actions-39-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies:
4848
- pyqt=5.15.9
4949
- pyreadstat=1.2.0
5050
- pytables=3.8.0
51-
- python-calamine=0.1.6
51+
- python-calamine=0.1.7
5252
- pyxlsb=1.0.10
5353
- s3fs=2022.11.0
5454
- scipy=1.10.0

ci/deps/actions-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
- pyqt>=5.15.9
4747
- pyreadstat>=1.2.0
4848
- pytables>=3.8.0
49-
- python-calamine>=0.1.6
49+
- python-calamine>=0.1.7
5050
- pyxlsb>=1.0.10
5151
- s3fs>=2022.11.0
5252
- scipy>=1.10.0

ci/deps/circle-310-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies:
4646
- pyqt>=5.15.9
4747
- pyreadstat>=1.2.0
4848
- pytables>=3.8.0
49-
- python-calamine>=0.1.6
49+
- python-calamine>=0.1.7
5050
- pyxlsb>=1.0.10
5151
- s3fs>=2022.11.0
5252
- scipy>=1.10.0

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ xlrd 2.0.1 excel Reading Excel
281281
xlsxwriter 3.0.5 excel Writing Excel
282282
openpyxl 3.1.0 excel Reading / writing for xlsx files
283283
pyxlsb 1.0.10 excel Reading for xlsb files
284-
python-calamine 0.1.6 excel Reading for xls/xlsx/xlsb/ods files
284+
python-calamine 0.1.7 excel Reading for xls/xlsx/xlsb/ods files
285285
========================= ================== =============== =============================================================
286286

287287
HTML

doc/source/user_guide/categorical.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ Pivot tables:
647647
648648
raw_cat = pd.Categorical(["a", "a", "b", "b"], categories=["a", "b", "c"])
649649
df = pd.DataFrame({"A": raw_cat, "B": ["c", "d", "c", "d"], "values": [1, 2, 3, 4]})
650-
pd.pivot_table(df, values="values", index=["A", "B"])
650+
pd.pivot_table(df, values="values", index=["A", "B"], observed=False)
651651
652652
Data munging
653653
------------

doc/source/user_guide/io.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1490,9 +1490,9 @@ rows will skip the intervening rows.
14901490

14911491
.. ipython:: python
14921492
1493-
from pandas._testing import makeCustomDataframe as mkdf
1494-
1495-
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
1493+
mi_idx = pd.MultiIndex.from_arrays([[1, 2, 3, 4], list("abcd")], names=list("ab"))
1494+
mi_col = pd.MultiIndex.from_arrays([[1, 2], list("ab")], names=list("cd"))
1495+
df = pd.DataFrame(np.ones((4, 2)), index=mi_idx, columns=mi_col)
14961496
df.to_csv("mi.csv")
14971497
print(open("mi.csv").read())
14981498
pd.read_csv("mi.csv", header=[0, 1, 2, 3], index_col=[0, 1])

doc/source/whatsnew/v0.12.0.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ IO enhancements
250250

251251
.. ipython:: python
252252
253-
from pandas._testing import makeCustomDataframe as mkdf
254-
255-
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
253+
mi_idx = pd.MultiIndex.from_arrays([[1, 2, 3, 4], list("abcd")], names=list("ab"))
254+
mi_col = pd.MultiIndex.from_arrays([[1, 2], list("ab")], names=list("cd"))
255+
df = pd.DataFrame(np.ones((4, 2)), index=mi_idx, columns=mi_col)
256256
df.to_csv("mi.csv")
257257
print(open("mi.csv").read())
258258
pd.read_csv("mi.csv", header=[0, 1, 2, 3], index_col=[0, 1])

doc/source/whatsnew/v0.23.0.rst

+26-5
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,33 @@ For pivoting operations, this behavior is *already* controlled by the ``dropna``
286286
df = pd.DataFrame({"A": cat1, "B": cat2, "values": [1, 2, 3, 4]})
287287
df
288288
289-
.. ipython:: python
290289
291-
pd.pivot_table(df, values='values', index=['A', 'B'],
292-
dropna=True)
293-
pd.pivot_table(df, values='values', index=['A', 'B'],
294-
dropna=False)
290+
.. code-block:: ipython
291+
292+
In [1]: pd.pivot_table(df, values='values', index=['A', 'B'], dropna=True)
293+
294+
Out[1]:
295+
values
296+
A B
297+
a c 1.0
298+
d 2.0
299+
b c 3.0
300+
d 4.0
301+
302+
In [2]: pd.pivot_table(df, values='values', index=['A', 'B'], dropna=False)
303+
304+
Out[2]:
305+
values
306+
A B
307+
a c 1.0
308+
d 2.0
309+
y NaN
310+
b c 3.0
311+
d 4.0
312+
y NaN
313+
z c NaN
314+
d NaN
315+
y NaN
295316
296317
297318
.. _whatsnew_0230.enhancements.window_raw:

doc/source/whatsnew/v2.1.2.rst

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Fixed regressions
3838
Bug fixes
3939
~~~~~~~~~
4040
- Fixed bug in :class:`.DataFrameGroupBy` reductions not preserving object dtype when ``infer_string`` is set (:issue:`55620`)
41-
- Fixed bug in :meth:`.DataFrameGroupBy.min()` and :meth:`.DataFrameGroupBy.max()` not preserving extension dtype for empty object (:issue:`55619`)
4241
- Fixed bug in :meth:`.SeriesGroupBy.value_counts` returning incorrect dtype for string columns (:issue:`55627`)
4342
- Fixed bug in :meth:`Categorical.equals` if other has arrow backed string dtype (:issue:`55364`)
4443
- Fixed bug in :meth:`DataFrame.__setitem__` not inferring string dtype for zero-dimensional array with ``infer_string=True`` (:issue:`55366`)

doc/source/whatsnew/v2.1.4.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ including other versions of pandas.
1313

1414
Fixed regressions
1515
~~~~~~~~~~~~~~~~~
16-
-
16+
- Fixed regression when trying to read a pickled pandas :class:`DataFrame` from pandas 1.3 (:issue:`55137`)
1717
-
1818

1919
.. ---------------------------------------------------------------------------
@@ -24,6 +24,7 @@ Bug fixes
2424
- Bug in :class:`Series` constructor raising DeprecationWarning when ``index`` is a list of :class:`Series` (:issue:`55228`)
2525
- Bug in :meth:`Index.__getitem__` returning wrong result for Arrow dtypes and negative stepsize (:issue:`55832`)
2626
- Fixed bug in :func:`to_numeric` converting to extension dtype for ``string[pyarrow_numpy]`` dtype (:issue:`56179`)
27+
- Fixed bug in :meth:`.DataFrameGroupBy.min()` and :meth:`.DataFrameGroupBy.max()` not preserving extension dtype for empty object (:issue:`55619`)
2728
- Fixed bug in :meth:`DataFrame.__setitem__` casting :class:`Index` with object-dtype to PyArrow backed strings when ``infer_string`` option is set (:issue:`55638`)
2829
- Fixed bug in :meth:`DataFrame.to_hdf` raising when columns have ``StringDtype`` (:issue:`55088`)
2930
- Fixed bug in :meth:`Index.insert` casting object-dtype to PyArrow backed strings when ``infer_string`` option is set (:issue:`55638`)

0 commit comments

Comments
 (0)