Skip to content

Commit 885eb18

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 49277_tmp
# Conflicts: # doc/source/whatsnew/v1.5.2.rst
2 parents 556a8e4 + b8bcf50 commit 885eb18

File tree

425 files changed

+4372
-7725
lines changed

Some content is hidden

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

425 files changed

+4372
-7725
lines changed

.github/workflows/32-bit-linux.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
paths-ignore:
1513
- "doc/**"
1614

.github/workflows/code-checks.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412

1513
env:
1614
ENV_FILE: environment.yml
@@ -88,7 +86,7 @@ jobs:
8886
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
8987
if: ${{ steps.build.outcome == 'success' && always() }}
9088

91-
- name: Typing
89+
- name: Typing + pylint
9290
uses: pre-commit/[email protected]
9391
with:
9492
extra_args: --hook-stage manual --all-files

.github/workflows/docbuild-and-upload.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
tags:
109
- '*'
1110
pull_request:
1211
branches:
1312
- main
1413
- 1.5.x
15-
- 1.4.x
1614

1715
env:
1816
ENV_FILE: environment.yml

.github/workflows/macos-windows.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
paths-ignore:
1513
- "doc/**"
1614

.github/workflows/python-dev.yml

-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ on:
2525
branches:
2626
- main
2727
- 1.5.x
28-
- 1.4.x
2928
pull_request:
3029
branches:
3130
- main
3231
- 1.5.x
33-
- 1.4.x
3432
paths-ignore:
3533
- "doc/**"
3634

.github/workflows/sdist.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
types: [labeled, opened, synchronize, reopened]
1513
paths-ignore:
1614
- "doc/**"
@@ -30,7 +28,7 @@ jobs:
3028
strategy:
3129
fail-fast: false
3230
matrix:
33-
python-version: ["3.8", "3.9", "3.10"]
31+
python-version: ["3.8", "3.9", "3.10", "3.11"]
3432
concurrency:
3533
# https://github.community/t/concurrecy-not-work-for-push/183068/7
3634
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist
@@ -42,7 +40,7 @@ jobs:
4240
fetch-depth: 0
4341

4442
- name: Set up Python
45-
uses: actions/setup-python@v3
43+
uses: actions/setup-python@v4
4644
with:
4745
python-version: ${{ matrix.python-version }}
4846

@@ -86,6 +84,8 @@ jobs:
8684
pip install numpy==1.20.3 ;;
8785
3.10)
8886
pip install numpy==1.21.2 ;;
87+
3.11)
88+
pip install numpy==1.23.2 ;;
8989
esac
9090
9191
- name: Import pandas

.github/workflows/ubuntu.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
paths-ignore:
1513
- "doc/**"
1614

.github/workflows/wheels.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,22 @@ jobs:
7272
env:
7373
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
7474

75-
# Used to test the built wheels
76-
- uses: actions/setup-python@v4
75+
# Used to test(Windows-only) and push the built wheels
76+
# You might need to use setup-python separately
77+
# if the new Python-dev version
78+
# is unavailable on conda-forge.
79+
- uses: conda-incubator/setup-miniconda@v2
7780
with:
81+
auto-update-conda: true
7882
python-version: ${{ matrix.python[1] }}
83+
activate-environment: test
84+
channels: conda-forge, anaconda
85+
channel-priority: true
86+
mamba-version: "*"
7987

8088
- name: Test wheels (Windows 64-bit only)
8189
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
82-
shell: cmd
90+
shell: cmd /C CALL {0}
8391
run: |
8492
python ci/test_wheels.py wheelhouse
8593
@@ -88,26 +96,15 @@ jobs:
8896
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
8997
path: ./wheelhouse/*.whl
9098

91-
# Used to push the built wheels
92-
# TODO: once Python 3.11 is available on conda, de-dup with
93-
# setup python above
94-
- uses: conda-incubator/setup-miniconda@v2
95-
with:
96-
auto-update-conda: true
97-
# Really doesn't matter what version we upload with
98-
# just the version we test with
99-
python-version: '3.8'
100-
channels: conda-forge
101-
channel-priority: true
102-
mamba-version: "*"
10399

104100
- name: Install anaconda client
105101
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
102+
shell: bash -el {0}
106103
run: conda install -q -y anaconda-client
107104

108105

109106
- name: Upload wheels
110-
if: success()
107+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
111108
shell: bash -el {0}
112109
env:
113110
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
@@ -180,11 +177,12 @@ jobs:
180177

181178
- name: Install anaconda client
182179
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
180+
shell: bash -el {0}
183181
run: |
184182
conda install -q -y anaconda-client
185183
186184
- name: Upload sdist
187-
if: success()
185+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
188186
shell: bash -el {0}
189187
env:
190188
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}

.pre-commit-config.yaml

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ repos:
1818
pass_filenames: true
1919
require_serial: false
2020
- repo: https://github.com/python/black
21-
rev: 22.8.0
21+
rev: 22.10.0
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/codespell-project/codespell
25-
rev: v2.2.1
25+
rev: v2.2.2
2626
hooks:
2727
- id: codespell
2828
types_or: [python, rst, markdown]
2929
- repo: https://github.com/MarcoGorelli/cython-lint
30-
rev: v0.1.8
30+
rev: v0.2.1
3131
hooks:
3232
- id: cython-lint
3333
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -60,15 +60,16 @@ repos:
6060
- flake8-bugbear==22.7.1
6161
- pandas-dev-flaker==0.5.0
6262
- repo: https://github.com/pycqa/pylint
63-
rev: v2.15.3
63+
rev: v2.15.5
6464
hooks:
6565
- id: pylint
66+
stages: [manual]
6667
- repo: https://github.com/PyCQA/isort
6768
rev: 5.10.1
6869
hooks:
6970
- id: isort
7071
- repo: https://github.com/asottile/pyupgrade
71-
rev: v2.38.2
72+
rev: v3.2.0
7273
hooks:
7374
- id: pyupgrade
7475
args: [--py38-plus]
@@ -83,7 +84,7 @@ repos:
8384
types: [text] # overwrite types: [rst]
8485
types_or: [python, rst]
8586
- repo: https://github.com/sphinx-contrib/sphinx-lint
86-
rev: v0.6.1
87+
rev: v0.6.7
8788
hooks:
8889
- id: sphinx-lint
8990
- repo: https://github.com/asottile/yesqa

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,6 @@ You can also triage issues which may include reproducing bug reports, or asking
166166

167167
Or maybe through using pandas you have an idea of your own or are looking for something in the documentation and thinking ‘this can be improved’...you can do something about it!
168168

169-
Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas).
169+
Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Slack](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack).
170170

171171
As contributors and maintainers to this project, you are expected to abide by pandas' code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/pandas-dev/.github/blob/master/CODE_OF_CONDUCT.md)

asv_bench/benchmarks/attrs_caching.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup(self):
1515
self.cur_index = self.df.index
1616

1717
def time_get_index(self):
18-
self.foo = self.df.index
18+
self.df.index
1919

2020
def time_set_index(self):
2121
self.df.index = self.cur_index

asv_bench/benchmarks/frame_methods.py

-20
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,6 @@ def time_frame_get_numeric_data(self):
2828
self.df._get_numeric_data()
2929

3030

31-
class Lookup:
32-
def setup(self):
33-
self.df = DataFrame(np.random.randn(10000, 8), columns=list("abcdefgh"))
34-
self.df["foo"] = "bar"
35-
self.row_labels = list(self.df.index[::10])[:900]
36-
self.col_labels = list(self.df.columns) * 100
37-
self.row_labels_all = np.array(
38-
list(self.df.index) * len(self.df.columns), dtype="object"
39-
)
40-
self.col_labels_all = np.array(
41-
list(self.df.columns) * len(self.df.index), dtype="object"
42-
)
43-
44-
def time_frame_fancy_lookup(self):
45-
self.df.lookup(self.row_labels, self.col_labels)
46-
47-
def time_frame_fancy_lookup_all(self):
48-
self.df.lookup(self.row_labels_all, self.col_labels_all)
49-
50-
5131
class Reindex:
5232
def setup(self):
5333
N = 10**3

asv_bench/benchmarks/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def time_different_python_functions_multicol(self, df):
310310
df.groupby(["key1", "key2"]).agg([sum, min, max])
311311

312312
def time_different_python_functions_singlecol(self, df):
313-
df.groupby("key1").agg([sum, min, max])
313+
df.groupby("key1")[["value1", "value2", "value3"]].agg([sum, min, max])
314314

315315

316316
class GroupStrings:

asv_bench/benchmarks/index_cached_properties.py

-3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,3 @@ def time_engine(self, index_type):
7070

7171
def time_inferred_type(self, index_type):
7272
self.idx.inferred_type
73-
74-
def time_is_all_dates(self, index_type):
75-
self.idx.is_all_dates

asv_bench/benchmarks/inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class ToDatetimeFormat:
223223
def setup(self):
224224
N = 100000
225225
self.s = Series(["19MAY11", "19MAY11:00:00:00"] * N)
226-
self.s2 = self.s.str.replace(":\\S+$", "")
226+
self.s2 = self.s.str.replace(":\\S+$", "", regex=True)
227227

228228
self.same_offset = ["10/11/2018 00:00:00.045-07:00"] * N
229229
self.diff_offset = [

asv_bench/benchmarks/io/hdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def setup(self):
4343
np.random.randn(N, 100), index=date_range("1/1/2000", periods=N)
4444
)
4545
self.df_dc = DataFrame(
46-
np.random.randn(N, 10), columns=["C%03d" % i for i in range(10)]
46+
np.random.randn(N, 10), columns=[f"C{i:03d}" for i in range(10)]
4747
)
4848

4949
self.fname = "__test__.h5"

asv_bench/benchmarks/join_merge.py

-20
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,6 @@
2222
from pandas import ordered_merge as merge_ordered
2323

2424

25-
class Append:
26-
def setup(self):
27-
self.df1 = DataFrame(np.random.randn(10000, 4), columns=["A", "B", "C", "D"])
28-
self.df2 = self.df1.copy()
29-
self.df2.index = np.arange(10000, 20000)
30-
self.mdf1 = self.df1.copy()
31-
self.mdf1["obj1"] = "bar"
32-
self.mdf1["obj2"] = "bar"
33-
self.mdf1["int1"] = 5
34-
self.mdf1 = self.mdf1._consolidate()
35-
self.mdf2 = self.mdf1.copy()
36-
self.mdf2.index = self.df2.index
37-
38-
def time_append_homogenous(self):
39-
self.df1.append(self.df2)
40-
41-
def time_append_mixed(self):
42-
self.mdf1.append(self.mdf2)
43-
44-
4525
class Concat:
4626

4727
params = [0, 1]

asv_bench/benchmarks/multiindex_object.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,14 @@ def setup(self, dtype):
369369
}
370370

371371
self.midx = data[dtype]
372-
self.values = self.midx[:100]
372+
self.values_small = self.midx[:100]
373+
self.values_large = self.midx[100:]
373374

374-
def time_isin(self, dtype):
375-
self.midx.isin(self.values)
375+
def time_isin_small(self, dtype):
376+
self.midx.isin(self.values_small)
377+
378+
def time_isin_large(self, dtype):
379+
self.midx.isin(self.values_large)
376380

377381

378382
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)