Skip to content

Commit 917ff6c

Browse files
committed
Merge branch 'master' into 41457-upgrade-to-bootstrap5
Merge to pass CI tests
2 parents 79a496f + b73c38e commit 917ff6c

File tree

311 files changed

+6380
-3378
lines changed

Some content is hidden

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

311 files changed

+6380
-3378
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ repos:
1919
types_or: [python, rst, markdown]
2020
files: ^(pandas|doc)/
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
22-
rev: v3.4.0
22+
rev: v4.0.1
2323
hooks:
2424
- id: debug-statements
2525
- id: end-of-file-fixer
2626
exclude: \.txt$
2727
- id: trailing-whitespace
2828
- repo: https://github.com/cpplint/cpplint
29-
rev: f7061b1 # the latest tag does not have the hook
29+
rev: 1.5.5
3030
hooks:
3131
- id: cpplint
3232
# We don't lint all C files because we don't want to lint any that are built
@@ -57,7 +57,7 @@ repos:
5757
hooks:
5858
- id: isort
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v2.12.0
60+
rev: v2.18.3
6161
hooks:
6262
- id: pyupgrade
6363
args: [--py37-plus]
@@ -72,7 +72,7 @@ repos:
7272
types: [text] # overwrite types: [rst]
7373
types_or: [python, rst]
7474
- repo: https://github.com/asottile/yesqa
75-
rev: v1.2.2
75+
rev: v1.2.3
7676
hooks:
7777
- id: yesqa
7878
additional_dependencies:

.travis.yml

-73
This file was deleted.

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pydata/pandas)
1818
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)
1919
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
20+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
2021

2122
## What is it?
2223

@@ -101,8 +102,8 @@ pip install pandas
101102

102103
## Dependencies
103104
- [NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays](https://www.numpy.org)
104-
- [python-dateutil - Provides powerful extensions to the standard datetime module](https://labix.org/python-dateutil)
105-
- [pytz - Brings the Olson tz database into Python which allows accurate and cross platform timezone calculations](https://pythonhosted.org/pytz)
105+
- [python-dateutil - Provides powerful extensions to the standard datetime module](https://dateutil.readthedocs.io/en/stable/index.html)
106+
- [pytz - Brings the Olson tz database into Python which allows accurate and cross platform timezone calculations](https://github.com/stub42/pytz)
106107

107108
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
108109

@@ -121,7 +122,7 @@ cloning the git repo), execute:
121122
python setup.py install
122123
```
123124

124-
or for installing in [development mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs):
125+
or for installing in [development mode](https://pip.pypa.io/en/latest/cli/pip_install/#install-editable):
125126

126127

127128
```sh

asv_bench/benchmarks/algorithms.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,38 @@ class Factorize:
2323
"int",
2424
"uint",
2525
"float",
26-
"string",
26+
"object",
2727
"datetime64[ns]",
2828
"datetime64[ns, tz]",
2929
"Int64",
3030
"boolean",
31-
"string_arrow",
31+
"string[pyarrow]",
3232
],
3333
]
3434
param_names = ["unique", "sort", "dtype"]
3535

3636
def setup(self, unique, sort, dtype):
3737
N = 10 ** 5
3838
string_index = tm.makeStringIndex(N)
39-
try:
40-
from pandas.core.arrays.string_arrow import ArrowStringDtype
41-
42-
string_arrow = pd.array(string_index, dtype=ArrowStringDtype())
43-
except ImportError:
44-
string_arrow = None
45-
46-
if dtype == "string_arrow" and not string_arrow:
47-
raise NotImplementedError
39+
string_arrow = None
40+
if dtype == "string[pyarrow]":
41+
try:
42+
string_arrow = pd.array(string_index, dtype="string[pyarrow]")
43+
except ImportError:
44+
raise NotImplementedError
4845

4946
data = {
5047
"int": pd.Int64Index(np.arange(N)),
5148
"uint": pd.UInt64Index(np.arange(N)),
5249
"float": pd.Float64Index(np.random.randn(N)),
53-
"string": string_index,
50+
"object": string_index,
5451
"datetime64[ns]": pd.date_range("2011-01-01", freq="H", periods=N),
5552
"datetime64[ns, tz]": pd.date_range(
5653
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
5754
),
5855
"Int64": pd.array(np.arange(N), dtype="Int64"),
5956
"boolean": pd.array(np.random.randint(0, 2, N), dtype="boolean"),
60-
"string_arrow": string_arrow,
57+
"string[pyarrow]": string_arrow,
6158
}[dtype]
6259
if not unique:
6360
data = data.repeat(5)

asv_bench/benchmarks/algos/isin.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class IsIn:
2525
"category[object]",
2626
"category[int]",
2727
"str",
28-
"string",
29-
"arrow_string",
28+
"string[python]",
29+
"string[pyarrow]",
3030
]
3131
param_names = ["dtype"]
3232

@@ -62,9 +62,7 @@ def setup(self, dtype):
6262
self.values = np.random.choice(arr, sample_size)
6363
self.series = Series(arr).astype("category")
6464

65-
elif dtype in ["str", "string", "arrow_string"]:
66-
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
67-
65+
elif dtype in ["str", "string[python]", "string[pyarrow]"]:
6866
try:
6967
self.series = Series(tm.makeStringIndex(N), dtype=dtype)
7068
except ImportError:

asv_bench/benchmarks/frame_methods.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,9 @@ class Rank:
652652
]
653653

654654
def setup(self, dtype):
655-
self.df = DataFrame(np.random.randn(10000, 10), columns=range(10), dtype=dtype)
655+
self.df = DataFrame(
656+
np.random.randn(10000, 10).astype(dtype), columns=range(10), dtype=dtype
657+
)
656658

657659
def time_rank(self, dtype):
658660
self.df.rank()

asv_bench/benchmarks/plotting.py

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import importlib
2+
import sys
3+
14
import matplotlib
25
import numpy as np
6+
import pkg_resources
37

48
from pandas import (
59
DataFrame,
@@ -13,6 +17,8 @@
1317
except ImportError:
1418
from pandas.tools.plotting import andrews_curves
1519

20+
from pandas.plotting._core import _get_plot_backend
21+
1622
matplotlib.use("Agg")
1723

1824

@@ -99,4 +105,28 @@ def time_plot_andrews_curves(self):
99105
andrews_curves(self.df, "Name")
100106

101107

108+
class BackendLoading:
109+
repeat = 1
110+
number = 1
111+
warmup_time = 0
112+
113+
def setup(self):
114+
dist = pkg_resources.get_distribution("pandas")
115+
spec = importlib.machinery.ModuleSpec("my_backend", None)
116+
mod = importlib.util.module_from_spec(spec)
117+
mod.plot = lambda *args, **kwargs: 1
118+
119+
backends = pkg_resources.get_entry_map("pandas")
120+
my_entrypoint = pkg_resources.EntryPoint(
121+
"pandas_plotting_backend", mod.__name__, dist=dist
122+
)
123+
backends["pandas_plotting_backends"][mod.__name__] = my_entrypoint
124+
for i in range(10):
125+
backends["pandas_plotting_backends"][str(i)] = my_entrypoint
126+
sys.modules["my_backend"] = mod
127+
128+
def time_get_plot_backend(self):
129+
_get_plot_backend("my_backend")
130+
131+
102132
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/strings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212

1313

1414
class Dtypes:
15-
params = ["str", "string", "arrow_string"]
15+
params = ["str", "string[python]", "string[pyarrow]"]
1616
param_names = ["dtype"]
1717

1818
def setup(self, dtype):
19-
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
20-
2119
try:
2220
self.s = Series(tm.makeStringIndex(10 ** 5), dtype=dtype)
2321
except ImportError:

ci/check_git_tags.sh

-28
This file was deleted.

ci/deps/actions-38-numpydev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212

1313
# pandas dependencies
1414
- pytz
15-
- pip=20.2
15+
- pip
1616
- pip:
1717
- cython==0.29.21 # GH#34014
1818
- "git+git://github.com/dateutil/dateutil.git"
File renamed without changes.

ci/prep_cython_cache.sh

-74
This file was deleted.

0 commit comments

Comments
 (0)