Skip to content

Commit 4ec7af6

Browse files
author
MomIsBestFriend
committed
Merge remote-tracking branch 'upstream/master' into CI-TestCase-#29886
2 parents 370cd59 + 95e1a63 commit 4ec7af6

File tree

343 files changed

+6107
-12666
lines changed

Some content is hidden

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

343 files changed

+6107
-12666
lines changed

.travis.yml

+19-16
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,34 @@ matrix:
3030
- python: 3.5
3131

3232
include:
33-
- dist: trusty
34-
env:
33+
- env:
3534
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network)"
3635

37-
- dist: trusty
38-
env:
36+
- env:
3937
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
4038

41-
- dist: trusty
42-
env:
43-
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8"
39+
- env:
40+
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
41+
services:
42+
- mysql
43+
- postgresql
4444

45-
- dist: trusty
46-
env:
47-
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
45+
- env:
46+
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
47+
services:
48+
- mysql
49+
- postgresql
4850

4951
# In allow_failures
50-
- dist: trusty
51-
env:
52-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
52+
- env:
53+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow" SQL="1"
54+
services:
55+
- mysql
56+
- postgresql
5357

5458
allow_failures:
55-
- dist: trusty
56-
env:
57-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
59+
- env:
60+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow" SQL="1"
5861

5962
before_install:
6063
- echo "before_install"

LICENSES/MSGPACK_LICENSE

-13
This file was deleted.

LICENSES/MSGPACK_NUMPY_LICENSE

-33
This file was deleted.

MANIFEST.in

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ global-exclude *.gz
2020
global-exclude *.h5
2121
global-exclude *.html
2222
global-exclude *.json
23-
global-exclude *.msgpack
2423
global-exclude *.pickle
2524
global-exclude *.png
2625
global-exclude *.pyc

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Here are just a few of the things that pandas does well:
124124
and saving/loading data from the ultrafast [**HDF5 format**][hdfstore]
125125
- [**Time series**][timeseries]-specific functionality: date range
126126
generation and frequency conversion, moving window statistics,
127-
moving window linear regressions, date shifting and lagging, etc.
127+
date shifting and lagging.
128128

129129

130130
[missing-data]: https://pandas.pydata.org/pandas-docs/stable/missing_data.html#working-with-missing-data

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/frame_ctor.py

+12
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,16 @@ def time_frame_from_lists(self):
105105
self.df = DataFrame(self.data)
106106

107107

108+
class FromRange:
109+
110+
goal_time = 0.2
111+
112+
def setup(self):
113+
N = 1_000_000
114+
self.data = range(N)
115+
116+
def time_frame_from_range(self):
117+
self.df = DataFrame(self.data)
118+
119+
108120
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/frame_methods.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,9 @@ class Dropna:
321321

322322
def setup(self, how, axis):
323323
self.df = DataFrame(np.random.randn(10000, 1000))
324-
with warnings.catch_warnings(record=True):
325-
self.df.ix[50:1000, 20:50] = np.nan
326-
self.df.ix[2000:3000] = np.nan
327-
self.df.ix[:, 60:70] = np.nan
324+
self.df.iloc[50:1000, 20:50] = np.nan
325+
self.df.iloc[2000:3000] = np.nan
326+
self.df.iloc[:, 60:70] = np.nan
328327
self.df_mixed = self.df.copy()
329328
self.df_mixed["foo"] = "bar"
330329

@@ -342,10 +341,9 @@ class Count:
342341

343342
def setup(self, axis):
344343
self.df = DataFrame(np.random.randn(10000, 1000))
345-
with warnings.catch_warnings(record=True):
346-
self.df.ix[50:1000, 20:50] = np.nan
347-
self.df.ix[2000:3000] = np.nan
348-
self.df.ix[:, 60:70] = np.nan
344+
self.df.iloc[50:1000, 20:50] = np.nan
345+
self.df.iloc[2000:3000] = np.nan
346+
self.df.iloc[:, 60:70] = np.nan
349347
self.df_mixed = self.df.copy()
350348
self.df_mixed["foo"] = "bar"
351349

asv_bench/benchmarks/indexing.py

-32
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ def time_iloc_scalar(self, index, index_structure):
6767
def time_iloc_slice(self, index, index_structure):
6868
self.data.iloc[:800000]
6969

70-
def time_ix_array(self, index, index_structure):
71-
with warnings.catch_warnings(record=True):
72-
self.data.ix[self.array]
73-
74-
def time_ix_list_like(self, index, index_structure):
75-
with warnings.catch_warnings(record=True):
76-
self.data.ix[[800000]]
77-
78-
def time_ix_scalar(self, index, index_structure):
79-
with warnings.catch_warnings(record=True):
80-
self.data.ix[800000]
81-
82-
def time_ix_slice(self, index, index_structure):
83-
with warnings.catch_warnings(record=True):
84-
self.data.ix[:800000]
85-
8670
def time_loc_array(self, index, index_structure):
8771
self.data.loc[self.array]
8872

@@ -148,10 +132,6 @@ def setup(self):
148132
self.bool_indexer = self.df[self.col_scalar] > 0
149133
self.bool_obj_indexer = self.bool_indexer.astype(object)
150134

151-
def time_ix(self):
152-
with warnings.catch_warnings(record=True):
153-
self.df.ix[self.idx_scalar, self.col_scalar]
154-
155135
def time_loc(self):
156136
self.df.loc[self.idx_scalar, self.col_scalar]
157137

@@ -228,14 +208,6 @@ def setup(self):
228208
self.idx = IndexSlice[20000:30000, 20:30, 35:45, 30000:40000]
229209
self.mdt = self.mdt.set_index(["A", "B", "C", "D"]).sort_index()
230210

231-
def time_series_ix(self):
232-
with warnings.catch_warnings(record=True):
233-
self.s.ix[999]
234-
235-
def time_frame_ix(self):
236-
with warnings.catch_warnings(record=True):
237-
self.df.ix[999]
238-
239211
def time_index_slice(self):
240212
self.mdt.loc[self.idx, :]
241213

@@ -310,10 +282,6 @@ def setup_cache(self):
310282
def time_lookup_iloc(self, s):
311283
s.iloc
312284

313-
def time_lookup_ix(self, s):
314-
with warnings.catch_warnings(record=True):
315-
s.ix
316-
317285
def time_lookup_loc(self, s):
318286
s.loc
319287

asv_bench/benchmarks/io/msgpack.py

-32
This file was deleted.

asv_bench/benchmarks/io/sas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ def setup(self, format):
2626
]
2727
self.f = os.path.join(*paths)
2828

29-
def time_read_msgpack(self, format):
29+
def time_read_sas(self, format):
3030
read_sas(self.f, format=format)

ci/azure/posix.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ jobs:
4444
PATTERN: "not slow and not network"
4545
LOCALE_OVERRIDE: "zh_CN.UTF-8"
4646

47-
# Disabled for NumPy object-dtype warning.
48-
# https://github.com/pandas-dev/pandas/issues/30043
49-
# py37_np_dev:
50-
# ENV_FILE: ci/deps/azure-37-numpydev.yaml
51-
# CONDA_PY: "37"
52-
# PATTERN: "not slow and not network"
53-
# TEST_ARGS: "-W error"
54-
# PANDAS_TESTING_MODE: "deprecate"
55-
# EXTRA_APT: "xsel"
47+
py37_np_dev:
48+
ENV_FILE: ci/deps/azure-37-numpydev.yaml
49+
CONDA_PY: "37"
50+
PATTERN: "not slow and not network"
51+
TEST_ARGS: "-W error"
52+
PANDAS_TESTING_MODE: "deprecate"
53+
EXTRA_APT: "xsel"
5654

5755
steps:
5856
- script: |

ci/code_checks.sh

+13-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function invgrep {
3939
}
4040

4141
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
42-
FLAKE8_FORMAT="##[error]%(path)s:%(row)s:%(col)s:%(code):%(text)s"
42+
FLAKE8_FORMAT="##[error]%(path)s:%(row)s:%(col)s:%(code)s:%(text)s"
4343
INVGREP_PREPEND="##[error]"
4444
else
4545
FLAKE8_FORMAT="default"
@@ -94,18 +94,23 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
9494

9595
# We don't lint all C files because we don't want to lint any that are built
9696
# from Cython files nor do we want to lint C files that we didn't modify for
97-
# this particular codebase (e.g. src/headers, src/klib, src/msgpack). However,
97+
# this particular codebase (e.g. src/headers, src/klib). However,
9898
# we can lint all header files since they aren't "generated" like C files are.
9999
MSG='Linting .c and .h' ; echo $MSG
100-
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime pandas/io/msgpack pandas/_libs/*.cpp pandas/util
100+
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime pandas/_libs/*.cpp
101101
RET=$(($RET + $?)) ; echo $MSG "DONE"
102102

103103
echo "isort --version-number"
104104
isort --version-number
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
@@ -284,6 +289,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
284289
pytest -q --doctest-modules pandas/core/arrays/string_.py
285290
RET=$(($RET + $?)) ; echo $MSG "DONE"
286291

292+
MSG='Doctests arrays/boolean.py' ; echo $MSG
293+
pytest -q --doctest-modules pandas/core/arrays/boolean.py
294+
RET=$(($RET + $?)) ; echo $MSG "DONE"
295+
287296
fi
288297

289298
### DOCSTRINGS ###

ci/deps/azure-36-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- lxml
1919
- matplotlib=2.2.2
2020
- numpy=1.14.*
21-
- openpyxl=2.4.8
21+
- openpyxl=2.5.7
2222
- python-dateutil
2323
- python-blosc
2424
- pytz=2017.2

0 commit comments

Comments
 (0)