Skip to content

Commit b27113c

Browse files
authored
Merge branch 'master' into single_level
2 parents 2c84ef7 + 397e36c commit b27113c

File tree

282 files changed

+6942
-4824
lines changed

Some content is hidden

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

282 files changed

+6942
-4824
lines changed

.github/CODE_OF_CONDUCT.md

-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ and the [Swift Code of Conduct][swift].
6060
[homepage]: https://www.contributor-covenant.org
6161
[version]: https://www.contributor-covenant.org/version/1/3/0/
6262
[swift]: https://swift.org/community/#code-of-conduct
63-

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
# This can be removed when the ipython directive fails when there are errors,
126126
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
127127
- name: Check ipython directive errors
128-
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
128+
run: "! grep -B10 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
129129

130130
- name: Install ssh key
131131
run: |

.pre-commit-config.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
hooks:
55
- id: black
66
- repo: https://gitlab.com/pycqa/flake8
7-
rev: 3.8.3
7+
rev: 3.8.4
88
hooks:
99
- id: flake8
1010
additional_dependencies: [flake8-comprehensions>=3.1.0]
@@ -43,3 +43,12 @@ repos:
4343
entry: python -m scripts.generate_pip_deps_from_conda
4444
files: ^(environment.yml|requirements-dev.txt)$
4545
pass_filenames: false
46+
- repo: https://github.com/asottile/yesqa
47+
rev: v1.2.2
48+
hooks:
49+
- id: yesqa
50+
- repo: https://github.com/pre-commit/pre-commit-hooks
51+
rev: v3.2.0
52+
hooks:
53+
- id: end-of-file-fixer
54+
exclude: '.html$|^LICENSES/|.csv$|.txt$|.svg$|.py$'

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ matrix:
4141
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
4242

4343
- env:
44-
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"
45-
46-
- env:
47-
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network and not clipboard)"
44+
- JOB="3.8, slow" ENV_FILE="ci/deps/travis-38-slow.yaml" PATTERN="slow" SQL="1"
45+
services:
46+
- mysql
47+
- postgresql
4848

4949
- env:
5050
- JOB="3.7, locale" ENV_FILE="ci/deps/travis-37-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"

AUTHORS.md

-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ pandas is distributed under a 3-clause ("Simplified" or "New") BSD
5454
license. Parts of NumPy, SciPy, numpydoc, bottleneck, which all have
5555
BSD-compatible licenses, are included. Their licenses follow the pandas
5656
license.
57-

asv_bench/benchmarks/dtypes.py

+57
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import string
2+
13
import numpy as np
24

5+
from pandas import DataFrame
6+
import pandas._testing as tm
37
from pandas.api.types import pandas_dtype
48

59
from .pandas_vb_common import (
@@ -62,4 +66,57 @@ def time_infer(self, dtype):
6266
lib.infer_dtype(self.data_dict[dtype], skipna=False)
6367

6468

69+
class SelectDtypes:
70+
71+
params = [
72+
tm.ALL_INT_DTYPES
73+
+ tm.ALL_EA_INT_DTYPES
74+
+ tm.FLOAT_DTYPES
75+
+ tm.COMPLEX_DTYPES
76+
+ tm.DATETIME64_DTYPES
77+
+ tm.TIMEDELTA64_DTYPES
78+
+ tm.BOOL_DTYPES
79+
]
80+
param_names = ["dtype"]
81+
82+
def setup(self, dtype):
83+
N, K = 5000, 50
84+
self.index = tm.makeStringIndex(N)
85+
self.columns = tm.makeStringIndex(K)
86+
87+
def create_df(data):
88+
return DataFrame(data, index=self.index, columns=self.columns)
89+
90+
self.df_int = create_df(np.random.randint(low=100, size=(N, K)))
91+
self.df_float = create_df(np.random.randn(N, K))
92+
self.df_bool = create_df(np.random.choice([True, False], size=(N, K)))
93+
self.df_string = create_df(
94+
np.random.choice(list(string.ascii_letters), size=(N, K))
95+
)
96+
97+
def time_select_dtype_int_include(self, dtype):
98+
self.df_int.select_dtypes(include=dtype)
99+
100+
def time_select_dtype_int_exclude(self, dtype):
101+
self.df_int.select_dtypes(exclude=dtype)
102+
103+
def time_select_dtype_float_include(self, dtype):
104+
self.df_float.select_dtypes(include=dtype)
105+
106+
def time_select_dtype_float_exclude(self, dtype):
107+
self.df_float.select_dtypes(exclude=dtype)
108+
109+
def time_select_dtype_bool_include(self, dtype):
110+
self.df_bool.select_dtypes(include=dtype)
111+
112+
def time_select_dtype_bool_exclude(self, dtype):
113+
self.df_bool.select_dtypes(exclude=dtype)
114+
115+
def time_select_dtype_string_include(self, dtype):
116+
self.df_string.select_dtypes(include=dtype)
117+
118+
def time_select_dtype_string_exclude(self, dtype):
119+
self.df_string.select_dtypes(exclude=dtype)
120+
121+
65122
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/indexing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def setup(self, index):
191191
}
192192
index = indexes[index]
193193
self.s = Series(np.random.rand(N), index=index)
194-
self.indexer = [True, False, True, True, False] * 20000
194+
self.indexer = np.random.randint(0, N, size=N)
195195

196196
def time_take(self, index):
197197
self.s.take(self.indexer)

asv_bench/benchmarks/pandas_vb_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Compatibility import for the testing module
1717
try:
18-
import pandas._testing as tm # noqa
18+
import pandas._testing as tm
1919
except ImportError:
2020
import pandas.util.testing as tm # noqa
2121

asv_bench/benchmarks/tslibs/offsets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pandas import offsets
1010

1111
try:
12-
import pandas.tseries.holiday # noqa
12+
import pandas.tseries.holiday
1313
except ImportError:
1414
pass
1515

ci/azure/posix.yml

+14-18
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,35 @@ jobs:
2020
CONDA_PY: "37"
2121
PATTERN: "not slow and not network and not clipboard"
2222

23+
py37:
24+
ENV_FILE: ci/deps/azure-37.yaml
25+
CONDA_PY: "37"
26+
PATTERN: "not slow and not network and not clipboard"
27+
2328
py37_locale_slow:
2429
ENV_FILE: ci/deps/azure-37-locale_slow.yaml
2530
CONDA_PY: "37"
2631
PATTERN: "slow"
27-
# pandas does not use the language (zh_CN), but should support different encodings (utf8)
28-
# we should test with encodings different than utf8, but doesn't seem like Ubuntu supports any
29-
LANG: "zh_CN.utf8"
30-
LC_ALL: "zh_CN.utf8"
31-
EXTRA_APT: "language-pack-zh-hans"
32+
LANG: "it_IT.utf8"
33+
LC_ALL: "it_IT.utf8"
34+
EXTRA_APT: "language-pack-it xsel"
3235

3336
py37_slow:
3437
ENV_FILE: ci/deps/azure-37-slow.yaml
3538
CONDA_PY: "37"
3639
PATTERN: "slow"
3740

38-
py37_locale:
39-
ENV_FILE: ci/deps/azure-37-locale.yaml
40-
CONDA_PY: "37"
41-
PATTERN: "not slow and not network"
42-
LANG: "it_IT.utf8"
43-
LC_ALL: "it_IT.utf8"
44-
EXTRA_APT: "language-pack-it xsel"
45-
46-
# py37_32bit:
47-
# ENV_FILE: ci/deps/azure-37-32bit.yaml
48-
# CONDA_PY: "37"
49-
# PATTERN: "not slow and not network and not clipboard"
50-
# BITS32: "yes"
41+
py38:
42+
ENV_FILE: ci/deps/azure-38.yaml
43+
CONDA_PY: "38"
44+
PATTERN: "not slow and not network and not clipboard"
5145

5246
py38_locale:
5347
ENV_FILE: ci/deps/azure-38-locale.yaml
5448
CONDA_PY: "38"
5549
PATTERN: "not slow and not network"
50+
# pandas does not use the language (zh_CN), but should support different encodings (utf8)
51+
# we should test with encodings different than utf8, but doesn't seem like Ubuntu supports any
5652
LANG: "zh_CN.utf8"
5753
LC_ALL: "zh_CN.utf8"
5854
EXTRA_APT: "language-pack-zh-hans xsel"

ci/deps/azure-37-32bit.yaml

-26
This file was deleted.

ci/deps/azure-37-slow.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
13+
- pytest-azurepipelines
1314

1415
# pandas dependencies
1516
- beautifulsoup4

ci/deps/travis-37.yaml renamed to ci/deps/azure-37.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
13+
- pytest-azurepipelines
1314

1415
# pandas dependencies
1516
- botocore>=1.11

ci/deps/travis-38.yaml renamed to ci/deps/azure-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ dependencies:
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
13+
- pytest-azurepipelines
1314

1415
# pandas dependencies
1516
- numpy
1617
- python-dateutil
1718
- nomkl
1819
- pytz
19-
- pip
2020
- tabulate==0.8.3

ci/deps/travis-37-locale.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ dependencies:
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

14-
# pandas dependencies
14+
# required
15+
- numpy
16+
- python-dateutil
17+
- pytz
18+
19+
# optional
1520
- beautifulsoup4
1621
- blosc=1.15.0
1722
- python-blosc
@@ -20,22 +25,23 @@ dependencies:
2025
- ipython
2126
- jinja2
2227
- lxml=4.3.0
23-
- matplotlib=3.0.*
28+
- matplotlib
2429
- nomkl
2530
- numexpr
26-
- numpy
2731
- openpyxl
2832
- pandas-gbq
2933
- google-cloud-bigquery>=1.27.2 # GH 36436
3034
- pyarrow>=0.17
31-
- psycopg2=2.7
32-
- pymysql=0.7.11
3335
- pytables>=3.5.1
34-
- python-dateutil
35-
- pytz
3636
- scipy
37-
- sqlalchemy=1.3.0
3837
- xarray=0.12.0
3938
- xlrd
4039
- xlsxwriter
4140
- xlwt
41+
- moto
42+
- flask
43+
44+
# sql
45+
- psycopg2=2.7
46+
- pymysql=0.7.11
47+
- sqlalchemy=1.3.0

ci/deps/azure-37-locale.yaml renamed to ci/deps/travis-38-slow.yaml

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.7.*
6+
- python=3.8.*
77

88
# tools
99
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
12-
- pytest-asyncio
1312
- hypothesis>=3.58.0
14-
- pytest-azurepipelines
1513

1614
# pandas dependencies
1715
- beautifulsoup4
16+
- fsspec>=0.7.4
1817
- html5lib
19-
- ipython
20-
- jinja2
2118
- lxml
22-
- matplotlib>=3.3.0
23-
- moto
24-
- flask
25-
- nomkl
19+
- matplotlib
2620
- numexpr
27-
- numpy=1.16.*
21+
- numpy
2822
- openpyxl
23+
- patsy
24+
- psycopg2
25+
- pymysql
2926
- pytables
3027
- python-dateutil
3128
- pytz
29+
- s3fs>=0.4.0
30+
- moto>=1.3.14
3231
- scipy
33-
- xarray
32+
- sqlalchemy
3433
- xlrd
3534
- xlsxwriter
3635
- xlwt
3736
- moto
37+
- flask

ci/travis_process_gbq_encryption.sh

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ elif [[ -n ${!TRAVIS_IV_ENV} ]]; then
1010
export GBQ_PROJECT_ID='pandas-gbq-tests';
1111
echo 'Successfully decrypted gbq credentials'
1212
fi
13-

codecov.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
codecov:
22
branch: master
33

4-
comment: off
4+
comment: false
55

66
coverage:
77
status:
@@ -11,3 +11,6 @@ coverage:
1111
patch:
1212
default:
1313
target: '50'
14+
15+
github_checks:
16+
annotations: false

doc/data/iris.data

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ SepalLength,SepalWidth,PetalLength,PetalWidth,Name
148148
6.3,2.5,5.0,1.9,Iris-virginica
149149
6.5,3.0,5.2,2.0,Iris-virginica
150150
6.2,3.4,5.4,2.3,Iris-virginica
151-
5.9,3.0,5.1,1.8,Iris-virginica
151+
5.9,3.0,5.1,1.8,Iris-virginica

0 commit comments

Comments
 (0)