Skip to content

Commit 818fec4

Browse files
authored
Merge branch 'master' into replace_object
2 parents cf72b5a + 2f2876b commit 818fec4

File tree

406 files changed

+24642
-17198
lines changed

Some content is hidden

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

406 files changed

+24642
-17198
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ matrix:
3535
language: generic
3636
env:
3737
- JOB="3.5, OSX" ENV_FILE="ci/travis-35-osx.yaml" TEST_ARGS="--skip-slow --skip-network"
38+
39+
- dist: trusty
40+
env:
41+
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
42+
3843
- dist: trusty
3944
env:
4045
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true

MANIFEST.in

+23-11
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,39 @@ include LICENSE
33
include RELEASE.md
44
include README.md
55
include setup.py
6-
include pyproject.toml
76

87
graft doc
98
prune doc/build
109

10+
graft LICENSES
11+
1112
graft pandas
1213

13-
global-exclude *.so
14-
global-exclude *.pyd
14+
global-exclude *.bz2
15+
global-exclude *.csv
16+
global-exclude *.dta
17+
global-exclude *.gz
18+
global-exclude *.h5
19+
global-exclude *.html
20+
global-exclude *.json
21+
global-exclude *.msgpack
22+
global-exclude *.pickle
23+
global-exclude *.png
1524
global-exclude *.pyc
25+
global-exclude *.pyd
26+
global-exclude *.sas7bdat
27+
global-exclude *.so
28+
global-exclude *.xls
29+
global-exclude *.xlsm
30+
global-exclude *.xlsx
31+
global-exclude *.xpt
32+
global-exclude *.xz
33+
global-exclude *.zip
1634
global-exclude *~
17-
global-exclude \#*
18-
global-exclude .git*
1935
global-exclude .DS_Store
20-
global-exclude *.png
36+
global-exclude .git*
37+
global-exclude \#*
2138

22-
# include examples/data/*
23-
# recursive-include examples *.py
24-
# recursive-include doc/source *
25-
# recursive-include doc/sphinxext *
26-
# recursive-include LICENSES *
2739
include versioneer.py
2840
include pandas/_version.py
2941
include pandas/io/formats/templates/*.tpl

asv_bench/benchmarks/categoricals.py

+52
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,55 @@ def time_categorical_series_is_monotonic_increasing(self):
193193

194194
def time_categorical_series_is_monotonic_decreasing(self):
195195
self.s.is_monotonic_decreasing
196+
197+
198+
class Contains(object):
199+
200+
goal_time = 0.2
201+
202+
def setup(self):
203+
N = 10**5
204+
self.ci = tm.makeCategoricalIndex(N)
205+
self.c = self.ci.values
206+
self.key = self.ci.categories[0]
207+
208+
def time_categorical_index_contains(self):
209+
self.key in self.ci
210+
211+
def time_categorical_contains(self):
212+
self.key in self.c
213+
214+
215+
class CategoricalSlicing(object):
216+
217+
goal_time = 0.2
218+
params = ['monotonic_incr', 'monotonic_decr', 'non_monotonic']
219+
param_names = ['index']
220+
221+
def setup(self, index):
222+
N = 10**6
223+
values = list('a' * N + 'b' * N + 'c' * N)
224+
indices = {
225+
'monotonic_incr': pd.Categorical(values),
226+
'monotonic_decr': pd.Categorical(reversed(values)),
227+
'non_monotonic': pd.Categorical(list('abc' * N))}
228+
self.data = indices[index]
229+
230+
self.scalar = 10000
231+
self.list = list(range(10000))
232+
self.cat_scalar = 'b'
233+
234+
def time_getitem_scalar(self, index):
235+
self.data[self.scalar]
236+
237+
def time_getitem_slice(self, index):
238+
self.data[:self.scalar]
239+
240+
def time_getitem_list_like(self, index):
241+
self.data[[self.scalar]]
242+
243+
def time_getitem_list(self, index):
244+
self.data[self.list]
245+
246+
def time_getitem_bool_array(self, index):
247+
self.data[self.data == self.cat_scalar]

asv_bench/benchmarks/frame_methods.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def time_info(self):
501501
class NSort(object):
502502

503503
goal_time = 0.2
504-
params = ['first', 'last']
504+
params = ['first', 'last', 'all']
505505
param_names = ['keep']
506506

507507
def setup(self, keep):

asv_bench/benchmarks/groupby.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
8-
TimeGrouper, Categorical)
8+
TimeGrouper, Categorical, Timestamp)
99
import pandas.util.testing as tm
1010

1111
from .pandas_vb_common import setup # noqa
@@ -385,6 +385,25 @@ def time_dtype_as_field(self, dtype, method, application):
385385
self.as_field_method()
386386

387387

388+
class RankWithTies(object):
389+
# GH 21237
390+
goal_time = 0.2
391+
param_names = ['dtype', 'tie_method']
392+
params = [['float64', 'float32', 'int64', 'datetime64'],
393+
['first', 'average', 'dense', 'min', 'max']]
394+
395+
def setup(self, dtype, tie_method):
396+
N = 10**4
397+
if dtype == 'datetime64':
398+
data = np.array([Timestamp("2011/01/01")] * N, dtype=dtype)
399+
else:
400+
data = np.array([1] * N, dtype=dtype)
401+
self.df = DataFrame({'values': data, 'key': ['foo'] * N})
402+
403+
def time_rank_ties(self, dtype, tie_method):
404+
self.df.groupby('key').rank(method=tie_method)
405+
406+
388407
class Float32(object):
389408
# GH 13335
390409
goal_time = 0.2

asv_bench/benchmarks/indexing.py

+45-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import numpy as np
44
import pandas.util.testing as tm
55
from pandas import (Series, DataFrame, MultiIndex, Int64Index, Float64Index,
6-
IntervalIndex, IndexSlice, concat, date_range)
6+
IntervalIndex, CategoricalIndex,
7+
IndexSlice, concat, date_range)
78
from .pandas_vb_common import setup, Panel # noqa
89

910

@@ -230,6 +231,49 @@ def time_loc_list(self, monotonic):
230231
monotonic.loc[80000:]
231232

232233

234+
class CategoricalIndexIndexing(object):
235+
236+
goal_time = 0.2
237+
params = ['monotonic_incr', 'monotonic_decr', 'non_monotonic']
238+
param_names = ['index']
239+
240+
def setup(self, index):
241+
N = 10**5
242+
values = list('a' * N + 'b' * N + 'c' * N)
243+
indices = {
244+
'monotonic_incr': CategoricalIndex(values),
245+
'monotonic_decr': CategoricalIndex(reversed(values)),
246+
'non_monotonic': CategoricalIndex(list('abc' * N))}
247+
self.data = indices[index]
248+
249+
self.int_scalar = 10000
250+
self.int_list = list(range(10000))
251+
252+
self.cat_scalar = 'b'
253+
self.cat_list = ['a', 'c']
254+
255+
def time_getitem_scalar(self, index):
256+
self.data[self.int_scalar]
257+
258+
def time_getitem_slice(self, index):
259+
self.data[:self.int_scalar]
260+
261+
def time_getitem_list_like(self, index):
262+
self.data[[self.int_scalar]]
263+
264+
def time_getitem_list(self, index):
265+
self.data[self.int_list]
266+
267+
def time_getitem_bool_array(self, index):
268+
self.data[self.data == self.cat_scalar]
269+
270+
def time_get_loc_scalar(self, index):
271+
self.data.get_loc(self.cat_scalar)
272+
273+
def time_get_indexer_list(self, index):
274+
self.data.get_indexer(self.cat_list)
275+
276+
233277
class PanelIndexing(object):
234278

235279
goal_time = 0.2

asv_bench/benchmarks/period.py

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ def setup(self):
6464
def time_setitem_period_column(self):
6565
self.df['col'] = self.rng
6666

67+
def time_set_index(self):
68+
# GH#21582 limited by comparisons of Period objects
69+
self.df['col2'] = self.rng
70+
self.df.set_index('col2', append=True)
71+
6772

6873
class Algorithms(object):
6974

asv_bench/benchmarks/series_methods.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def time_isin(self, dtypes):
4141
class NSort(object):
4242

4343
goal_time = 0.2
44-
params = ['last', 'first']
44+
params = ['first', 'last', 'all']
4545
param_names = ['keep']
4646

4747
def setup(self, keep):

ci/appveyor-27.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- beautifulsoup4
77
- bottleneck
88
- dateutil
9+
- gcsfs
910
- html5lib
1011
- jinja2=2.8
1112
- lxml
@@ -23,7 +24,7 @@ dependencies:
2324
- xlsxwriter
2425
- xlwt
2526
# universal
26-
- cython
27+
- cython>=0.28.2
2728
- pytest
2829
- pytest-xdist
2930
- moto

ci/appveyor-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ dependencies:
2222
- xlsxwriter
2323
- xlwt
2424
# universal
25-
- cython
25+
- cython>=0.28.2
2626
- pytest
2727
- pytest-xdist

ci/check_imports.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
blacklist = {
77
'bs4',
8+
'gcsfs',
89
'html5lib',
910
'ipython',
1011
'jinja2'

ci/circle-27-compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55
dependencies:
66
- bottleneck=1.0.0
7-
- cython=0.24
7+
- cython=0.28.2
88
- jinja2=2.8
99
- numexpr=2.4.4 # we test that we correctly don't use an unsupported numexpr
1010
- numpy=1.9.2

ci/circle-35-ascii.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas
22
channels:
33
- defaults
44
dependencies:
5-
- cython
5+
- cython>=0.28.2
66
- nomkl
77
- numpy
88
- python-dateutil

ci/circle-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55
dependencies:
66
- beautifulsoup4
7-
- cython
7+
- cython>=0.28.2
88
- html5lib
99
- ipython
1010
- jinja2

ci/circle-36-locale_slow.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ channels:
44
- conda-forge
55
dependencies:
66
- beautifulsoup4
7-
- cython
7+
- cython>=0.28.2
8+
- gcsfs
89
- html5lib
910
- ipython
1011
- jinja2

ci/environment-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- Cython
6+
- Cython>=0.28.2
77
- NumPy
88
- flake8
99
- moto

ci/lint.sh

+8
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ if [ "$LINT" ]; then
174174
fi
175175
echo "Check for old-style classes DONE"
176176

177+
echo "Check for backticks incorrectly rendering because of missing spaces"
178+
grep -R --include="*.rst" -E "[a-zA-Z0-9]\`\`?[a-zA-Z0-9]" doc/source/
179+
180+
if [ $? = "0" ]; then
181+
RET=1
182+
fi
183+
echo "Check for backticks incorrectly rendering because of missing spaces DONE"
184+
177185
else
178186
echo "NOT Linting"
179187
fi

ci/requirements-optional-conda.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ blosc
33
bottleneck
44
fastparquet
55
feather-format
6+
gcsfs
67
html5lib
78
ipython>=5.6.0
89
ipykernel
@@ -21,6 +22,7 @@ s3fs
2122
scipy
2223
seaborn
2324
sqlalchemy
25+
statsmodels
2426
xarray
2527
xlrd
2628
xlsxwriter

ci/requirements-optional-pip.txt

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ blosc
55
bottleneck
66
fastparquet
77
feather-format
8+
gcsfs
89
html5lib
910
ipython>=5.6.0
1011
ipykernel
@@ -23,6 +24,7 @@ s3fs
2324
scipy
2425
seaborn
2526
sqlalchemy
27+
statsmodels
2628
xarray
2729
xlrd
2830
xlsxwriter

ci/script_single.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ if [ "$DOC" ]; then
2525
echo "We are not running pytest as this is a doc-build"
2626

2727
elif [ "$COVERAGE" ]; then
28-
echo pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
29-
pytest -s -m "single" --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
28+
echo pytest -s -m "single" -r xXs --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
29+
pytest -s -m "single" -r xXs --strict --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
3030

3131
else
32-
echo pytest -m "single" -r xX --junitxml=/tmp/single.xml --strict $TEST_ARGS pandas
33-
pytest -m "single" -r xX --junitxml=/tmp/single.xml --strict $TEST_ARGS pandas # TODO: doctest
32+
echo pytest -m "single" -r xXs --junitxml=/tmp/single.xml --strict $TEST_ARGS pandas
33+
pytest -m "single" -r xXs --junitxml=/tmp/single.xml --strict $TEST_ARGS pandas # TODO: doctest
3434

3535
fi
3636

ci/travis-27-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- conda-forge
55
dependencies:
66
- bottleneck=1.0.0
7-
- cython=0.24
7+
- cython=0.28.2
88
- lxml
99
- matplotlib=1.4.3
1010
- numpy=1.9.2

0 commit comments

Comments
 (0)