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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 23 additions & 11 deletions
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

Lines changed: 52 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 20 additions & 1 deletion
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

Lines changed: 45 additions & 1 deletion
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)