Skip to content

Commit 8151366

Browse files
author
MomIsBestFriend
committed
Merge remote-tracking branch 'upstream/master' into DOC-core-indexers
2 parents ba0fd9c + 8376067 commit 8151366

File tree

316 files changed

+3988
-10629
lines changed

Some content is hidden

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

316 files changed

+3988
-10629
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/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

+7-3
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,10 +94,10 @@ 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"
@@ -281,6 +281,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
281281
pytest -q --doctest-modules pandas/core/arrays/string_.py
282282
RET=$(($RET + $?)) ; echo $MSG "DONE"
283283

284+
MSG='Doctests arrays/boolean.py' ; echo $MSG
285+
pytest -q --doctest-modules pandas/core/arrays/boolean.py
286+
RET=$(($RET + $?)) ; echo $MSG "DONE"
287+
284288
fi
285289

286290
### 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

ci/deps/azure-36-minimum_versions.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ dependencies:
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines
14+
- psutil
1415

1516
# pandas dependencies
1617
- beautifulsoup4=4.6.0
1718
- bottleneck=1.2.1
1819
- jinja2=2.8
1920
- numexpr=2.6.2
2021
- numpy=1.13.3
21-
- openpyxl=2.4.8
22+
- openpyxl=2.5.7
2223
- pytables=3.4.2
2324
- python-dateutil=2.6.1
2425
- pytz=2017.2

ci/run_tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ sh -c "$PYTEST_CMD"
3838

3939
if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then
4040
echo "uploading coverage"
41-
echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME"
42-
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
41+
echo "bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME"
42+
bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME
4343
fi

ci/setup_env.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ echo "conda list"
140140
conda list
141141

142142
# Install DB for Linux
143-
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
143+
144+
if [[ -n ${SQL:0} ]]; then
144145
echo "installing dbs"
145146
mysql -e 'create database pandas_nosetest;'
146147
psql -c 'create database pandas_nosetest;' -U postgres

doc/redirects.csv

+1-5
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ generated/pandas.DataFrame.to_hdf,../reference/api/pandas.DataFrame.to_hdf
491491
generated/pandas.DataFrame.to,../reference/api/pandas.DataFrame.to
492492
generated/pandas.DataFrame.to_json,../reference/api/pandas.DataFrame.to_json
493493
generated/pandas.DataFrame.to_latex,../reference/api/pandas.DataFrame.to_latex
494-
generated/pandas.DataFrame.to_msgpack,../reference/api/pandas.DataFrame.to_msgpack
495494
generated/pandas.DataFrame.to_numpy,../reference/api/pandas.DataFrame.to_numpy
496495
generated/pandas.DataFrame.to_panel,../reference/api/pandas.DataFrame.to_panel
497496
generated/pandas.DataFrame.to_parquet,../reference/api/pandas.DataFrame.to_parquet
@@ -778,8 +777,7 @@ generated/pandas.io.formats.style.Styler.to_excel,../reference/api/pandas.io.for
778777
generated/pandas.io.formats.style.Styler.use,../reference/api/pandas.io.formats.style.Styler.use
779778
generated/pandas.io.formats.style.Styler.where,../reference/api/pandas.io.formats.style.Styler.where
780779
generated/pandas.io.json.build_table_schema,../reference/api/pandas.io.json.build_table_schema
781-
generated/pandas.io.json.json_normalize,../reference/api/pandas.io.json.json_normalize
782-
generated/pandas.io.stata.StataReader.data,../reference/api/pandas.io.stata.StataReader.data
780+
generated/pandas.io.json.json_normalize,../reference/api/pandas.json_normalize
783781
generated/pandas.io.stata.StataReader.data_label,../reference/api/pandas.io.stata.StataReader.data_label
784782
generated/pandas.io.stata.StataReader.value_labels,../reference/api/pandas.io.stata.StataReader.value_labels
785783
generated/pandas.io.stata.StataReader.variable_labels,../reference/api/pandas.io.stata.StataReader.variable_labels
@@ -890,7 +888,6 @@ generated/pandas.read_gbq,../reference/api/pandas.read_gbq
890888
generated/pandas.read_hdf,../reference/api/pandas.read_hdf
891889
generated/pandas.read,../reference/api/pandas.read
892890
generated/pandas.read_json,../reference/api/pandas.read_json
893-
generated/pandas.read_msgpack,../reference/api/pandas.read_msgpack
894891
generated/pandas.read_parquet,../reference/api/pandas.read_parquet
895892
generated/pandas.read_pickle,../reference/api/pandas.read_pickle
896893
generated/pandas.read_sas,../reference/api/pandas.read_sas
@@ -1231,7 +1228,6 @@ generated/pandas.Series.to_json,../reference/api/pandas.Series.to_json
12311228
generated/pandas.Series.to_latex,../reference/api/pandas.Series.to_latex
12321229
generated/pandas.Series.to_list,../reference/api/pandas.Series.to_list
12331230
generated/pandas.Series.tolist,../reference/api/pandas.Series.tolist
1234-
generated/pandas.Series.to_msgpack,../reference/api/pandas.Series.to_msgpack
12351231
generated/pandas.Series.to_numpy,../reference/api/pandas.Series.to_numpy
12361232
generated/pandas.Series.to_period,../reference/api/pandas.Series.to_period
12371233
generated/pandas.Series.to_pickle,../reference/api/pandas.Series.to_pickle

0 commit comments

Comments
 (0)