Skip to content

Commit 2669ee4

Browse files
author
How Si Wei
committed
Merge remote-tracking branch 'upstream/master' into businesshour
2 parents 1478845 + ea06f8d commit 2669ee4

File tree

128 files changed

+7119
-6207
lines changed

Some content is hidden

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

128 files changed

+7119
-6207
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://pandas.pydata.org/donate.html

.travis.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ matrix:
5151
# In allow_failures
5252
- dist: trusty
5353
env:
54-
- JOB="3.6, doc" ENV_FILE="environment.yml" DOC=true
54+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
5555
allow_failures:
5656
- dist: trusty
5757
env:
5858
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
5959
- dist: trusty
6060
env:
61-
- JOB="3.6, doc" ENV_FILE="environment.yml" DOC=true
61+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
6262

6363
before_install:
6464
- echo "before_install"
@@ -103,10 +103,5 @@ script:
103103
after_script:
104104
- echo "after_script start"
105105
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
106-
- if [ -e test-data-single.xml ]; then
107-
ci/print_skipped.py test-data-single.xml;
108-
fi
109-
- if [ -e test-data-multiple.xml ]; then
110-
ci/print_skipped.py test-data-multiple.xml;
111-
fi
106+
- ci/print_skipped.py
112107
- echo "after_script done"

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
// `asv` will cache wheels of the recent builds in each
108108
// environment, making them faster to install next time. This is
109109
// number of builds to keep, per environment.
110-
"wheel_cache_size": 8,
110+
"build_cache_size": 8,
111111

112112
// The commits after which the regression search in `asv publish`
113113
// should start looking for regressions. Dictionary whose keys are

asv_bench/benchmarks/index_object.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,34 @@ def time_get_loc(self):
188188

189189
class IntervalIndexMethod:
190190
# GH 24813
191-
params = [10**3, 10**5, 10**7]
191+
params = [10**3, 10**5]
192192

193193
def setup(self, N):
194194
left = np.append(np.arange(N), np.array(0))
195195
right = np.append(np.arange(1, N + 1), np.array(1))
196196
self.intv = IntervalIndex.from_arrays(left, right)
197197
self.intv._engine
198198

199+
self.intv2 = IntervalIndex.from_arrays(left + 1, right + 1)
200+
self.intv2._engine
201+
202+
self.left = IntervalIndex.from_breaks(np.arange(N))
203+
self.right = IntervalIndex.from_breaks(np.arange(N - 3, 2 * N - 3))
204+
199205
def time_monotonic_inc(self, N):
200206
self.intv.is_monotonic_increasing
201207

202208
def time_is_unique(self, N):
203209
self.intv.is_unique
204210

211+
def time_intersection(self, N):
212+
self.left.intersection(self.right)
213+
214+
def time_intersection_one_duplicate(self, N):
215+
self.intv.intersection(self.right)
216+
217+
def time_intersection_both_duplicate(self, N):
218+
self.intv.intersection(self.intv2)
219+
205220

206221
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/multiindex_object.py

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

33
import numpy as np
44
import pandas.util.testing as tm
5-
from pandas import date_range, MultiIndex
5+
from pandas import date_range, MultiIndex, DataFrame
66

77

88
class GetLoc:
@@ -126,4 +126,18 @@ def time_datetime_level_values_sliced(self, mi):
126126
mi[:10].values
127127

128128

129+
class CategoricalLevel:
130+
131+
def setup(self):
132+
133+
self.df = DataFrame({
134+
'a': np.arange(1_000_000, dtype=np.int32),
135+
'b': np.arange(1_000_000, dtype=np.int64),
136+
'c': np.arange(1_000_000, dtype=float),
137+
}).astype({'a': 'category', 'b': 'category'})
138+
139+
def time_categorical_level(self):
140+
self.df.set_index(['a', 'b'])
141+
142+
129143
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/timeseries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pandas import to_datetime, date_range, Series, DataFrame, period_range
66
from pandas.tseries.frequencies import infer_freq
77
try:
8-
from pandas.plotting._converter import DatetimeConverter
8+
from pandas.plotting._matplotlib.converter import DatetimeConverter
99
except ImportError:
1010
from pandas.tseries.converter import DatetimeConverter
1111

ci/azure/posix.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,9 @@ jobs:
8989
# note that this will produce $LASTEXITCODE=1
9090
Write-Error "$($matches[1]) tests failed"
9191
}
92-
displayName: Check for test failures
92+
displayName: 'Check for test failures'
93+
- script: |
94+
export PATH=$HOME/miniconda3/bin:$PATH
95+
source activate pandas-dev
96+
python ci/print_skipped.py
97+
displayName: 'Print skipped tests'

ci/azure/windows.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818

1919
steps:
2020
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
21-
displayName: Add conda to PATH
21+
displayName: 'Add conda to PATH'
2222
- script: conda update -q -n base conda
2323
displayName: Update conda
2424
- script: conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
25-
displayName: Create anaconda environment
25+
displayName: 'Create anaconda environment'
2626
- script: |
2727
call activate pandas-dev
2828
call conda list
@@ -48,4 +48,9 @@ jobs:
4848
# note that this will produce $LASTEXITCODE=1
4949
Write-Error "$($matches[1]) tests failed"
5050
}
51-
displayName: Check for test failures
51+
displayName: 'Check for test failures'
52+
- script: |
53+
export PATH=$HOME/miniconda3/bin:$PATH
54+
source activate pandas-dev
55+
python ci/print_skipped.py
56+
displayName: 'Print skipped tests'

ci/deps/azure-35-compat.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dependencies:
2222
- hypothesis>=3.58.0
2323
- pytest-xdist
2424
- pytest-mock
25-
- isort
2625
- pip
2726
- pip:
2827
# for python 3.5, pytest>=4.0.2 is not available in conda

ci/deps/azure-36-locale.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dependencies:
2424
- pytest-xdist
2525
- pytest-mock
2626
- hypothesis>=3.58.0
27-
- isort
2827
- pip
2928
- pip:
3029
- html5lib==1.0b2

ci/deps/azure-36-locale_slow.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ dependencies:
3030
- pytest-xdist
3131
- pytest-mock
3232
- moto
33-
- isort
3433
- pip
3534
- pip:
3635
- hypothesis>=3.58.0

ci/deps/azure-37-locale.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dependencies:
2828
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
31-
- isort
3231
- pip
3332
- pip:
3433
- hypothesis>=3.58.0

ci/deps/azure-37-numpydev.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- pytest-xdist
1111
- pytest-mock
1212
- hypothesis>=3.58.0
13-
- isort
1413
- pip
1514
- pip:
1615
- "git+git://github.com/dateutil/dateutil.git"

ci/deps/azure-macos-35.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ dependencies:
2121
- xlrd
2222
- xlsxwriter
2323
- xlwt
24-
- isort
2524
- pip:
2625
- python-dateutil==2.5.3
2726
# universal

ci/deps/azure-windows-36.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ dependencies:
2727
- pytest-xdist
2828
- pytest-mock
2929
- hypothesis>=3.58.0
30-
- isort

ci/deps/azure-windows-37.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ dependencies:
3030
- pytest-mock
3131
- moto
3232
- hypothesis>=3.58.0
33-
- isort

ci/deps/travis-36-cov.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ dependencies:
2020
# https://github.com/pydata/pandas-gbq/issues/271
2121
- google-cloud-bigquery<=1.11
2222
- psycopg2
23-
- pyarrow=0.9.0
23+
# pyarrow segfaults on load: https://github.com/pandas-dev/pandas/issues/26716
24+
# - pyarrow=0.9.0
2425
- pymysql
2526
- pytables
2627
- python-snappy
@@ -41,7 +42,6 @@ dependencies:
4142
- pytest-cov
4243
- pytest-mock
4344
- hypothesis>=3.58.0
44-
- isort
4545
- pip
4646
- pip:
4747
- brotlipy

ci/deps/travis-36-doc.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- beautifulsoup4
7+
- bottleneck
8+
- cython>=0.28.2
9+
- fastparquet>=0.2.1
10+
- gitpython
11+
- html5lib
12+
- hypothesis>=3.58.0
13+
- ipykernel
14+
- ipython
15+
- ipywidgets
16+
- lxml
17+
- matplotlib
18+
- nbconvert>=5.4.1
19+
- nbformat
20+
- nbsphinx
21+
- notebook>=5.7.5
22+
- numexpr
23+
- numpy
24+
- numpydoc
25+
- openpyxl
26+
- pandoc
27+
- pyarrow
28+
- pyqt
29+
- pytables
30+
- python-dateutil
31+
- python-snappy
32+
- python=3.6.*
33+
- pytz
34+
- scipy
35+
- seaborn
36+
# recursion error with sphinx 2.1.0. https://github.com/pandas-dev/pandas/issues/26723
37+
- sphinx==2.0.1
38+
- sqlalchemy
39+
- statsmodels
40+
- xarray
41+
- xlrd
42+
- xlsxwriter
43+
- xlwt
44+
# universal
45+
- pytest>=4.0.2
46+
- pytest-xdist

ci/deps/travis-36-locale.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ dependencies:
3939
- pytest-xdist
4040
- pytest-mock
4141
- moto
42-
- isort
4342
- pip
4443
- pip:
4544
- hypothesis>=3.58.0

ci/deps/travis-36-slow.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ dependencies:
3030
- pytest-mock
3131
- moto
3232
- hypothesis>=3.58.0
33-
- isort

ci/deps/travis-37.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
- pytest-mock
1919
- hypothesis>=3.58.0
2020
- s3fs
21-
- isort
2221
- pip
2322
- pip:
2423
- moto

ci/print_skipped.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import os
34
import sys
45
import math
56
import xml.etree.ElementTree as et
@@ -36,19 +37,19 @@ def parse_results(filename):
3637
return '\n'.join(skipped)
3738

3839

39-
def main(args):
40+
def main():
41+
test_files = [
42+
'test-data-single.xml',
43+
'test-data-multiple.xml',
44+
'test-data.xml',
45+
]
46+
4047
print('SKIPPED TESTS:')
41-
for fn in args.filename:
42-
print(parse_results(fn))
48+
for fn in test_files:
49+
if os.path.isfile(fn):
50+
print(parse_results(fn))
4351
return 0
4452

4553

46-
def parse_args():
47-
import argparse
48-
parser = argparse.ArgumentParser()
49-
parser.add_argument('filename', nargs='+', help='XUnit file to parse')
50-
return parser.parse_args()
51-
52-
5354
if __name__ == '__main__':
54-
sys.exit(main(parse_args()))
55+
sys.exit(main())

doc/make.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ def html(self):
220220
if os.path.exists(zip_fname):
221221
os.remove(zip_fname)
222222

223-
if self.single_doc_html is not None:
224-
self._open_browser(self.single_doc_html)
225-
else:
226-
self._add_redirects()
223+
if ret_code == 0:
224+
if self.single_doc_html is not None:
225+
self._open_browser(self.single_doc_html)
226+
else:
227+
self._add_redirects()
227228
return ret_code
228229

229230
def latex(self, force=False):

doc/source/ecosystem.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,5 @@ Library Accessor Classes
363363
============== ========== =========================
364364

365365
.. _cyberpandas: https://cyberpandas.readthedocs.io/en/latest
366-
.. _pdvega: https://jakevdp.github.io/pdvega/
366+
.. _pdvega: https://altair-viz.github.io/pdvega/
367+

doc/source/getting_started/basics.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,8 @@ Iteration
14551455

14561456
The behavior of basic iteration over pandas objects depends on the type.
14571457
When iterating over a Series, it is regarded as array-like, and basic iteration
1458-
produces the values. Other data structures, like DataFrame,
1459-
follow the dict-like convention of iterating over the "keys" of the
1460-
objects.
1458+
produces the values. DataFrames follow the dict-like convention of iterating
1459+
over the "keys" of the objects.
14611460

14621461
In short, basic iteration (``for i in object``) produces:
14631462

@@ -1537,9 +1536,9 @@ For example:
15371536

15381537
.. ipython:: python
15391538
1540-
for item, frame in df.iteritems():
1541-
print(item)
1542-
print(frame)
1539+
for label, ser in df.iteritems():
1540+
print(label)
1541+
print(ser)
15431542
15441543
.. _basics.iterrows:
15451544

doc/source/reference/frame.rst

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ Reindexing / Selection / Label manipulation
204204
DataFrame.rename_axis
205205
DataFrame.reset_index
206206
DataFrame.sample
207-
DataFrame.select
208207
DataFrame.set_axis
209208
DataFrame.set_index
210209
DataFrame.tail

0 commit comments

Comments
 (0)