Skip to content

Commit 55a1dfa

Browse files
committed
Merge remote-tracking branch 'upstream/master' into BUG-allow-map-with-abc-mapping
2 parents 23ce436 + b9f26e2 commit 55a1dfa

File tree

415 files changed

+10223
-9780
lines changed

Some content is hidden

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

415 files changed

+10223
-9780
lines changed

.github/workflows/ci.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ on:
88

99
env:
1010
ENV_FILE: environment.yml
11-
# TODO: remove export PATH=... in each step once this works
12-
# PATH: $HOME/miniconda3/bin:$PATH
1311

1412
jobs:
1513
checks:
1614
name: Checks
1715
runs-on: ubuntu-latest
1816
steps:
1917

18+
- name: Setting conda path
19+
run: echo "::add-path::${HOME}/miniconda3/bin"
20+
2021
- name: Checkout
2122
uses: actions/checkout@v1
2223

@@ -25,79 +26,72 @@ jobs:
2526
if: true
2627

2728
- name: Setup environment and build pandas
28-
run: |
29-
export PATH=$HOME/miniconda3/bin:$PATH
30-
ci/setup_env.sh
29+
run: ci/setup_env.sh
3130
if: true
3231

3332
- name: Linting
3433
run: |
35-
export PATH=$HOME/miniconda3/bin:$PATH
3634
source activate pandas-dev
3735
ci/code_checks.sh lint
3836
if: true
3937

4038
- name: Dependencies consistency
4139
run: |
42-
export PATH=$HOME/miniconda3/bin:$PATH
4340
source activate pandas-dev
4441
ci/code_checks.sh dependencies
4542
if: true
4643

4744
- name: Checks on imported code
4845
run: |
49-
export PATH=$HOME/miniconda3/bin:$PATH
5046
source activate pandas-dev
5147
ci/code_checks.sh code
5248
if: true
5349

5450
- name: Running doctests
5551
run: |
56-
export PATH=$HOME/miniconda3/bin:$PATH
5752
source activate pandas-dev
5853
ci/code_checks.sh doctests
5954
if: true
6055

6156
- name: Docstring validation
6257
run: |
63-
export PATH=$HOME/miniconda3/bin:$PATH
6458
source activate pandas-dev
6559
ci/code_checks.sh docstrings
6660
if: true
6761

6862
- name: Typing validation
6963
run: |
70-
export PATH=$HOME/miniconda3/bin:$PATH
7164
source activate pandas-dev
7265
ci/code_checks.sh typing
7366
if: true
7467

7568
- name: Testing docstring validation script
7669
run: |
77-
export PATH=$HOME/miniconda3/bin:$PATH
7870
source activate pandas-dev
7971
pytest --capture=no --strict scripts
8072
if: true
8173

8274
- name: Running benchmarks
8375
run: |
84-
export PATH=$HOME/miniconda3/bin:$PATH
8576
source activate pandas-dev
8677
cd asv_bench
8778
asv check -E existing
8879
git remote add upstream https://github.com/pandas-dev/pandas.git
8980
git fetch upstream
9081
if git diff upstream/master --name-only | grep -q "^asv_bench/"; then
9182
asv machine --yes
92-
ASV_OUTPUT="$(asv dev)"
93-
if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then
94-
echo "##vso[task.logissue type=error]Benchmarks run with errors"
95-
echo "$ASV_OUTPUT"
83+
asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log
84+
if grep "failed" benchmarks.log > /dev/null ; then
9685
exit 1
97-
else
98-
echo "Benchmarks run without errors"
9986
fi
10087
else
10188
echo "Benchmarks did not run, no changes detected"
10289
fi
10390
if: true
91+
92+
- name: Publish benchmarks artifact
93+
uses: actions/upload-artifact@master
94+
with:
95+
name: Benchmarks log
96+
path: asv_bench/benchmarks.log
97+
if: failure()

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,11 @@ pip install pandas
164164
```
165165

166166
## Dependencies
167-
- [NumPy](https://www.numpy.org): 1.13.3 or higher
168-
- [python-dateutil](https://labix.org/python-dateutil): 2.5.0 or higher
169-
- [pytz](https://pythonhosted.org/pytz): 2015.4 or higher
167+
- [NumPy](https://www.numpy.org)
168+
- [python-dateutil](https://labix.org/python-dateutil)
169+
- [pytz](https://pythonhosted.org/pytz)
170170

171-
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
172-
for recommended and optional dependencies.
171+
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.
173172

174173
## Installation from sources
175174
To install pandas from source you need Cython in addition to the normal

asv_bench/benchmarks/array.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import numpy as np
2+
3+
import pandas as pd
4+
5+
6+
class BooleanArray:
7+
def setup(self):
8+
self.values_bool = np.array([True, False, True, False])
9+
self.values_float = np.array([1.0, 0.0, 1.0, 0.0])
10+
self.values_integer = np.array([1, 0, 1, 0])
11+
self.values_integer_like = [1, 0, 1, 0]
12+
13+
def time_from_bool_array(self):
14+
pd.array(self.values_bool, dtype="boolean")
15+
16+
def time_from_integer_array(self):
17+
pd.array(self.values_integer, dtype="boolean")
18+
19+
def time_from_integer_like(self):
20+
pd.array(self.values_integer_like, dtype="boolean")
21+
22+
def time_from_float_array(self):
23+
pd.array(self.values_float, dtype="boolean")

asv_bench/benchmarks/boolean.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import numpy as np
2+
3+
import pandas as pd
4+
5+
6+
class TimeLogicalOps:
7+
def setup(self):
8+
N = 10_000
9+
left, right, lmask, rmask = np.random.randint(0, 2, size=(4, N)).astype("bool")
10+
self.left = pd.arrays.BooleanArray(left, lmask)
11+
self.right = pd.arrays.BooleanArray(right, rmask)
12+
13+
def time_or_scalar(self):
14+
self.left | True
15+
self.left | False
16+
17+
def time_or_array(self):
18+
self.left | self.right
19+
20+
def time_and_scalar(self):
21+
self.left & True
22+
self.left & False
23+
24+
def time_and_array(self):
25+
self.left & self.right
26+
27+
def time_xor_scalar(self):
28+
self.left ^ True
29+
self.left ^ False
30+
31+
def time_xor_array(self):
32+
self.left ^ self.right

asv_bench/benchmarks/categoricals.py

+27-15
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,6 @@
1414
pass
1515

1616

17-
class Concat:
18-
def setup(self):
19-
N = 10 ** 5
20-
self.s = pd.Series(list("aabbcd") * N).astype("category")
21-
22-
self.a = pd.Categorical(list("aabbcd") * N)
23-
self.b = pd.Categorical(list("bbcdjk") * N)
24-
25-
def time_concat(self):
26-
pd.concat([self.s, self.s])
27-
28-
def time_union(self):
29-
union_categoricals([self.a, self.b])
30-
31-
3217
class Constructor:
3318
def setup(self):
3419
N = 10 ** 5
@@ -77,6 +62,33 @@ def time_existing_series(self):
7762
pd.Categorical(self.series)
7863

7964

65+
class CategoricalOps:
66+
params = ["__lt__", "__le__", "__eq__", "__ne__", "__ge__", "__gt__"]
67+
param_names = ["op"]
68+
69+
def setup(self, op):
70+
N = 10 ** 5
71+
self.cat = pd.Categorical(list("aabbcd") * N, ordered=True)
72+
73+
def time_categorical_op(self, op):
74+
getattr(self.cat, op)("b")
75+
76+
77+
class Concat:
78+
def setup(self):
79+
N = 10 ** 5
80+
self.s = pd.Series(list("aabbcd") * N).astype("category")
81+
82+
self.a = pd.Categorical(list("aabbcd") * N)
83+
self.b = pd.Categorical(list("bbcdjk") * N)
84+
85+
def time_concat(self):
86+
pd.concat([self.s, self.s])
87+
88+
def time_union(self):
89+
union_categoricals([self.a, self.b])
90+
91+
8092
class ValueCounts:
8193

8294
params = [True, False]

asv_bench/benchmarks/frame_methods.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def setup(self):
565565

566566
def time_frame_get_dtype_counts(self):
567567
with warnings.catch_warnings(record=True):
568-
self.df.get_dtype_counts()
568+
self.df._data.get_dtype_counts()
569569

570570
def time_info(self):
571571
self.df.info()

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

0 commit comments

Comments
 (0)