Skip to content

Commit 5e5aa9c

Browse files
authored
Merge branch 'master' into stringarray-nan
2 parents c649b1d + 8b858cd commit 5e5aa9c

File tree

595 files changed

+15067
-10859
lines changed

Some content is hidden

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

595 files changed

+15067
-10859
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ jobs:
136136
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
137137
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
138138

139+
- name: Copy cheatsheets into site directory
140+
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
141+
139142
- name: Upload web
140-
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
143+
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
141144
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
142145

143146
- name: Upload dev docs
@@ -146,6 +149,7 @@ jobs:
146149

147150
- name: Move docs into site directory
148151
run: mv doc/build/html web/build/docs
152+
149153
- name: Save website as an artifact
150154
uses: actions/upload-artifact@v2
151155
with:

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.9.7'
1921
- uses: pre-commit/[email protected]

.github/workflows/python-dev.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
PANDAS_CI: 1
1818
PATTERN: "not slow and not network and not clipboard"
1919
COVERAGE: true
20-
PYTEST_TARGET: pandas
20+
PYTEST_TARGET: pandas
2121

2222
jobs:
2323
build:
@@ -28,13 +28,10 @@ jobs:
2828
os: [ubuntu-latest, macOS-latest, windows-latest]
2929

3030
name: actions-310-dev
31-
timeout-minutes: 60
32-
33-
env:
34-
NUMPY_WHEELS_AVAILABLE: ${{ matrix.os == 'ubuntu-latest' }}
31+
timeout-minutes: 80
3532

3633
concurrency:
37-
group: ${{ github.ref }}-${{ matrix.os }}-dev
34+
group: ${{ github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
3835
cancel-in-progress: ${{github.event_name == 'pull_request'}}
3936

4037
steps:
@@ -51,11 +48,7 @@ jobs:
5148
shell: bash
5249
run: |
5350
python -m pip install --upgrade pip setuptools wheel
54-
if [[ "$NUMPY_WHEELS_AVAILABLE" == "true" ]]; then
55-
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
56-
else
57-
pip install git+https://github.com/numpy/numpy.git
58-
fi
51+
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
5952
pip install git+https://github.com/nedbat/coveragepy.git
6053
pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov
6154
pip list

.github/workflows/sdist.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
- uses: conda-incubator/setup-miniconda@v2
5454
with:
5555
activate-environment: pandas-sdist
56+
channels: conda-forge
5657
python-version: '${{ matrix.python-version }}'
5758

5859
- name: Install pandas from sdist

.pre-commit-config.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: absolufy-imports
1010
files: ^pandas/
1111
- repo: https://github.com/python/black
12-
rev: 21.9b0
12+
rev: 21.10b0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/codespell-project/codespell
@@ -39,10 +39,11 @@ repos:
3939
rev: 3.9.2
4040
hooks:
4141
- id: flake8
42-
additional_dependencies:
43-
- flake8-comprehensions==3.1.0
44-
- flake8-bugbear==21.3.2
45-
- pandas-dev-flaker==0.2.0
42+
additional_dependencies: &flake8_dependencies
43+
- flake8==3.9.2
44+
- flake8-comprehensions==3.1.0
45+
- flake8-bugbear==21.3.2
46+
- pandas-dev-flaker==0.2.0
4647
- id: flake8
4748
alias: flake8-cython
4849
name: flake8 (cython)
@@ -73,14 +74,10 @@ repos:
7374
types: [text] # overwrite types: [rst]
7475
types_or: [python, rst]
7576
- repo: https://github.com/asottile/yesqa
76-
rev: v1.2.3
77+
rev: v1.3.0
7778
hooks:
7879
- id: yesqa
79-
additional_dependencies:
80-
- flake8==3.9.2
81-
- flake8-comprehensions==3.1.0
82-
- flake8-bugbear==21.3.2
83-
- pandas-dev-flaker==0.2.0
80+
additional_dependencies: *flake8_dependencies
8481
- repo: local
8582
hooks:
8683
- id: pyright

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ global-exclude *.xlsb
3333
global-exclude *.xlsm
3434
global-exclude *.xlsx
3535
global-exclude *.xpt
36+
global-exclude *.cpt
3637
global-exclude *.xz
3738
global-exclude *.zip
3839
global-exclude *~

asv_bench/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// followed by the pip installed packages).
4040
"matrix": {
4141
"numpy": [],
42-
"Cython": ["0.29.21"],
42+
"Cython": ["0.29.24"],
4343
"matplotlib": [],
4444
"sqlalchemy": [],
4545
"scipy": [],

asv_bench/benchmarks/groupby.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class GroupByMethods:
443443
"var",
444444
],
445445
["direct", "transformation"],
446-
[1, 2, 5, 10],
446+
[1, 5],
447447
]
448448

449449
def setup(self, dtype, method, application, ncols):
@@ -455,6 +455,7 @@ def setup(self, dtype, method, application, ncols):
455455
raise NotImplementedError
456456

457457
if application == "transformation" and method in [
458+
"describe",
458459
"head",
459460
"tail",
460461
"unique",
@@ -464,7 +465,12 @@ def setup(self, dtype, method, application, ncols):
464465
# DataFrameGroupBy doesn't have these methods
465466
raise NotImplementedError
466467

467-
ngroups = 1000
468+
if method == "describe":
469+
ngroups = 20
470+
elif method in ["mad", "skew"]:
471+
ngroups = 100
472+
else:
473+
ngroups = 1000
468474
size = ngroups * 2
469475
rng = np.arange(ngroups).reshape(-1, 1)
470476
rng = np.broadcast_to(rng, (len(rng), ncols))
@@ -491,9 +497,6 @@ def setup(self, dtype, method, application, ncols):
491497
cols = cols[0]
492498

493499
if application == "transformation":
494-
if method == "describe":
495-
raise NotImplementedError
496-
497500
self.as_group_method = lambda: df.groupby("key")[cols].transform(method)
498501
self.as_field_method = lambda: df.groupby(cols)["key"].transform(method)
499502
else:

asv_bench/benchmarks/index_object.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def time_iter_dec(self):
8686
for _ in self.idx_dec:
8787
pass
8888

89+
def time_sort_values_asc(self):
90+
self.idx_inc.sort_values()
91+
92+
def time_sort_values_des(self):
93+
self.idx_inc.sort_values(ascending=False)
94+
8995

9096
class IndexEquals:
9197
def setup(self):

asv_bench/benchmarks/inference.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,16 @@ def time_dup_string_tzoffset_dates(self, cache):
277277
to_datetime(self.dup_string_with_tz, cache=cache)
278278

279279

280+
# GH 43901
281+
class ToDatetimeInferDatetimeFormat:
282+
def setup(self):
283+
rng = date_range(start="1/1/2000", periods=100000, freq="H")
284+
self.strings = rng.strftime("%Y-%m-%d %H:%M:%S").tolist()
285+
286+
def time_infer_datetime_format(self):
287+
to_datetime(self.strings, infer_datetime_format=True)
288+
289+
280290
class ToTimedelta:
281291
def setup(self):
282292
self.ints = np.random.randint(0, 60, size=10000)

asv_bench/benchmarks/io/csv.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,14 @@ def time_to_datetime_format_DD_MM_YYYY(self, cache_dates):
525525
to_datetime(df["date"], cache=cache_dates, format="%d-%m-%Y")
526526

527527

528+
class ReadCSVIndexCol(StringIORewind):
529+
def setup(self):
530+
count_elem = 100_000
531+
data = "a,b\n" + "1,2\n" * count_elem
532+
self.StringIO_input = StringIO(data)
533+
534+
def time_read_csv_index_col(self):
535+
read_csv(self.StringIO_input, index_col="a")
536+
537+
528538
from ..pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/pandas_vb_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
try:
1818
import pandas._testing as tm
1919
except ImportError:
20-
import pandas.util.testing as tm # noqa
20+
import pandas.util.testing as tm # noqa:F401
2121

2222

2323
numeric_dtypes = [

0 commit comments

Comments
 (0)