Skip to content

Commit a0d5529

Browse files
author
MomIsBestFriend
committed
Merge remote-tracking branch 'upstream/master' into STY-repr-batch-3
2 parents a67596b + 8830e85 commit a0d5529

File tree

173 files changed

+2594
-2840
lines changed

Some content is hidden

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

173 files changed

+2594
-2840
lines changed

asv_bench/benchmarks/index_object.py

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Float64Index,
88
Index,
99
IntervalIndex,
10+
MultiIndex,
1011
RangeIndex,
1112
Series,
1213
date_range,
@@ -111,6 +112,18 @@ def time_get_loc_dec(self):
111112
self.idx_dec.get_loc(100000)
112113

113114

115+
class IndexEquals:
116+
def setup(self):
117+
idx_large_fast = RangeIndex(100000)
118+
idx_small_slow = date_range(start="1/1/2012", periods=1)
119+
self.mi_large_slow = MultiIndex.from_product([idx_large_fast, idx_small_slow])
120+
121+
self.idx_non_object = RangeIndex(1)
122+
123+
def time_non_object_equals_multiindex(self):
124+
self.idx_non_object.equals(self.mi_large_slow)
125+
126+
114127
class IndexAppend:
115128
def setup(self):
116129

asv_bench/benchmarks/multiindex_object.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44

5-
from pandas import DataFrame, MultiIndex, date_range
5+
from pandas import DataFrame, MultiIndex, RangeIndex, date_range
66
import pandas.util.testing as tm
77

88

@@ -147,4 +147,16 @@ def time_categorical_level(self):
147147
self.df.set_index(["a", "b"])
148148

149149

150+
class Equals:
151+
def setup(self):
152+
idx_large_fast = RangeIndex(100000)
153+
idx_small_slow = date_range(start="1/1/2012", periods=1)
154+
self.mi_large_slow = MultiIndex.from_product([idx_large_fast, idx_small_slow])
155+
156+
self.idx_non_object = RangeIndex(1)
157+
158+
def time_equals_non_object_index(self):
159+
self.mi_large_slow.equals(self.idx_non_object)
160+
161+
150162
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/stat_ops.py

+28-52
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,14 @@
77

88
class FrameOps:
99

10-
params = [ops, ["float", "int"], [0, 1], [True, False]]
11-
param_names = ["op", "dtype", "axis", "use_bottleneck"]
10+
params = [ops, ["float", "int"], [0, 1]]
11+
param_names = ["op", "dtype", "axis"]
1212

13-
def setup(self, op, dtype, axis, use_bottleneck):
13+
def setup(self, op, dtype, axis):
1414
df = pd.DataFrame(np.random.randn(100000, 4)).astype(dtype)
15-
try:
16-
pd.options.compute.use_bottleneck = use_bottleneck
17-
except TypeError:
18-
from pandas.core import nanops
19-
20-
nanops._USE_BOTTLENECK = use_bottleneck
2115
self.df_func = getattr(df, op)
2216

23-
def time_op(self, op, dtype, axis, use_bottleneck):
17+
def time_op(self, op, dtype, axis):
2418
self.df_func(axis=axis)
2519

2620

@@ -46,20 +40,14 @@ def time_op(self, level, op):
4640

4741
class SeriesOps:
4842

49-
params = [ops, ["float", "int"], [True, False]]
50-
param_names = ["op", "dtype", "use_bottleneck"]
43+
params = [ops, ["float", "int"]]
44+
param_names = ["op", "dtype"]
5145

52-
def setup(self, op, dtype, use_bottleneck):
46+
def setup(self, op, dtype):
5347
s = pd.Series(np.random.randn(100000)).astype(dtype)
54-
try:
55-
pd.options.compute.use_bottleneck = use_bottleneck
56-
except TypeError:
57-
from pandas.core import nanops
58-
59-
nanops._USE_BOTTLENECK = use_bottleneck
6048
self.s_func = getattr(s, op)
6149

62-
def time_op(self, op, dtype, use_bottleneck):
50+
def time_op(self, op, dtype):
6351
self.s_func()
6452

6553

@@ -101,61 +89,49 @@ def time_average_old(self, constructor, pct):
10189

10290
class Correlation:
10391

104-
params = [["spearman", "kendall", "pearson"], [True, False]]
105-
param_names = ["method", "use_bottleneck"]
92+
params = [["spearman", "kendall", "pearson"]]
93+
param_names = ["method"]
10694

107-
def setup(self, method, use_bottleneck):
108-
try:
109-
pd.options.compute.use_bottleneck = use_bottleneck
110-
except TypeError:
111-
from pandas.core import nanops
95+
def setup(self, method):
96+
self.df = pd.DataFrame(np.random.randn(500, 15))
97+
self.df2 = pd.DataFrame(np.random.randn(500, 15))
98+
self.df_wide = pd.DataFrame(np.random.randn(500, 100))
99+
self.df_wide_nans = self.df_wide.where(np.random.random((500, 100)) < 0.9)
100+
self.s = pd.Series(np.random.randn(500))
101+
self.s2 = pd.Series(np.random.randn(500))
112102

113-
nanops._USE_BOTTLENECK = use_bottleneck
114-
self.df = pd.DataFrame(np.random.randn(1000, 30))
115-
self.df2 = pd.DataFrame(np.random.randn(1000, 30))
116-
self.df_wide = pd.DataFrame(np.random.randn(1000, 200))
117-
self.df_wide_nans = self.df_wide.where(np.random.random((1000, 200)) < 0.9)
118-
self.s = pd.Series(np.random.randn(1000))
119-
self.s2 = pd.Series(np.random.randn(1000))
120-
121-
def time_corr(self, method, use_bottleneck):
103+
def time_corr(self, method):
122104
self.df.corr(method=method)
123105

124-
def time_corr_wide(self, method, use_bottleneck):
106+
def time_corr_wide(self, method):
125107
self.df_wide.corr(method=method)
126108

127-
def time_corr_wide_nans(self, method, use_bottleneck):
109+
def time_corr_wide_nans(self, method):
128110
self.df_wide_nans.corr(method=method)
129111

130-
def peakmem_corr_wide(self, method, use_bottleneck):
112+
def peakmem_corr_wide(self, method):
131113
self.df_wide.corr(method=method)
132114

133-
def time_corr_series(self, method, use_bottleneck):
115+
def time_corr_series(self, method):
134116
self.s.corr(self.s2, method=method)
135117

136-
def time_corrwith_cols(self, method, use_bottleneck):
118+
def time_corrwith_cols(self, method):
137119
self.df.corrwith(self.df2, method=method)
138120

139-
def time_corrwith_rows(self, method, use_bottleneck):
121+
def time_corrwith_rows(self, method):
140122
self.df.corrwith(self.df2, axis=1, method=method)
141123

142124

143125
class Covariance:
144126

145-
params = [[True, False]]
146-
param_names = ["use_bottleneck"]
147-
148-
def setup(self, use_bottleneck):
149-
try:
150-
pd.options.compute.use_bottleneck = use_bottleneck
151-
except TypeError:
152-
from pandas.core import nanops
127+
params = []
128+
param_names = []
153129

154-
nanops._USE_BOTTLENECK = use_bottleneck
130+
def setup(self):
155131
self.s = pd.Series(np.random.randn(100000))
156132
self.s2 = pd.Series(np.random.randn(100000))
157133

158-
def time_cov_series(self, use_bottleneck):
134+
def time_cov_series(self):
159135
self.s.cov(self.s2)
160136

161137

ci/azure/posix.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
CONDA_PY: "36"
2121
PATTERN: "not slow and not network"
2222
py36_locale_slow_old_np:
23-
ENV_FILE: ci/deps/azure-36-locale.yaml
23+
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
2424
CONDA_PY: "36"
2525
PATTERN: "slow"
2626
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2727
EXTRA_APT: "language-pack-zh-hans"
2828

29-
py36_locale_slow:
30-
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
29+
py36_locale:
30+
ENV_FILE: ci/deps/azure-36-locale.yaml
3131
CONDA_PY: "36"
3232
PATTERN: "not slow and not network"
3333
LOCALE_OVERRIDE: "it_IT.UTF-8"

ci/code_checks.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
105105

106106
# Imports - Check formatting using isort see setup.cfg for settings
107107
MSG='Check import format using isort ' ; echo $MSG
108-
isort --recursive --check-only pandas asv_bench
108+
ISORT_CMD="isort --recursive --check-only pandas asv_bench"
109+
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
110+
eval $ISORT_CMD | awk '{print "##[error]" $0}'; RET=$(($RET + ${PIPESTATUS[0]}))
111+
else
112+
eval $ISORT_CMD
113+
fi
109114
RET=$(($RET + $?)) ; echo $MSG "DONE"
110115

111116
fi

ci/deps/azure-36-locale.yaml

+20-16
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,27 @@ dependencies:
1313
- pytest-azurepipelines
1414

1515
# pandas dependencies
16-
- beautifulsoup4==4.6.0
17-
- bottleneck=1.2.*
16+
- beautifulsoup4
17+
- gcsfs
18+
- html5lib
19+
- ipython
20+
- jinja2
1821
- lxml
19-
- matplotlib=2.2.2
20-
- numpy=1.14.*
21-
- openpyxl=2.4.8
22-
- python-dateutil
23-
- python-blosc
24-
- pytz=2017.2
25-
- scipy
26-
- sqlalchemy=1.1.4
27-
- xlrd=1.1.0
28-
- xlsxwriter=0.9.8
29-
- xlwt=1.2.0
22+
- matplotlib=3.0.*
23+
- nomkl
24+
- numexpr
25+
- numpy=1.15.*
26+
- openpyxl
3027
# lowest supported version of pyarrow (putting it here instead of in
3128
# azure-36-minimum_versions because it needs numpy >= 1.14)
3229
- pyarrow=0.12
33-
- pip
34-
- pip:
35-
- html5lib==1.0b2
30+
- pytables
31+
- python-dateutil
32+
- pytz
33+
- s3fs
34+
- scipy
35+
- xarray
36+
- xlrd
37+
- xlsxwriter
38+
- xlwt
39+
- moto

ci/deps/azure-36-locale_slow.yaml

+14-18
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,20 @@ dependencies:
1313
- pytest-azurepipelines
1414

1515
# pandas dependencies
16-
- beautifulsoup4
17-
- gcsfs
18-
- html5lib
19-
- ipython
20-
- jinja2
16+
- beautifulsoup4==4.6.0
17+
- bottleneck=1.2.*
2118
- lxml
22-
- matplotlib=3.0.*
23-
- nomkl
24-
- numexpr
25-
- numpy=1.15.*
26-
- openpyxl
27-
- pytables
19+
- matplotlib=2.2.2
20+
- numpy=1.14.*
21+
- openpyxl=2.4.8
2822
- python-dateutil
29-
- pytz
30-
- s3fs
23+
- python-blosc
24+
- pytz=2017.2
3125
- scipy
32-
- xarray
33-
- xlrd
34-
- xlsxwriter
35-
- xlwt
36-
- moto
26+
- sqlalchemy=1.1.4
27+
- xlrd=1.1.0
28+
- xlsxwriter=0.9.8
29+
- xlwt=1.2.0
30+
- pip
31+
- pip:
32+
- html5lib==1.0b2

0 commit comments

Comments
 (0)