Skip to content

Commit 2c6cf97

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pd.array
2 parents 86b81b5 + c911151 commit 2c6cf97

File tree

288 files changed

+9822
-7533
lines changed

Some content is hidden

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

288 files changed

+9822
-7533
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434
command: |
3535
export PATH="$MINICONDA_DIR/bin:$PATH"
3636
source activate pandas-dev
37-
echo "pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml --skip-slow --skip-network pandas"
38-
pytest --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml --skip-slow --skip-network pandas
37+
echo "pytest -m "not slow and not network" --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml pandas"
38+
pytest -m "not slow and not network" --strict --durations=10 --color=no --junitxml=$CIRCLE_TEST_REPORTS/reports/junit.xml pandas

.travis.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ matrix:
3434
include:
3535
- dist: trusty
3636
env:
37-
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
37+
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="not slow and not network"
3838

3939
- dist: trusty
4040
env:
41-
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
41+
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" PATTERN="slow"
4242
addons:
4343
apt:
4444
packages:
4545
- language-pack-zh-hans
4646
- dist: trusty
4747
env:
48-
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" TEST_ARGS="--skip-slow"
48+
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" PATTERN="not slow"
4949
addons:
5050
apt:
5151
packages:
5252
- python-gtk2
5353
- dist: trusty
5454
env:
55-
- JOB="3.6, lint, coverage" ENV_FILE="ci/deps/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
55+
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36.yaml" PATTERN="not slow and not network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true
5656
- dist: trusty
5757
env:
58-
- JOB="3.7, NumPy dev" ENV_FILE="ci/deps/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
58+
- JOB="3.7, NumPy dev" ENV_FILE="ci/deps/travis-37-numpydev.yaml" PATTERN="not slow and not network" TEST_ARGS="-W error" PANDAS_TESTING_MODE="deprecate"
5959
addons:
6060
apt:
6161
packages:
@@ -64,7 +64,7 @@ matrix:
6464
# In allow_failures
6565
- dist: trusty
6666
env:
67-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
67+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
6868

6969
# In allow_failures
7070
- dist: trusty
@@ -73,7 +73,7 @@ matrix:
7373
allow_failures:
7474
- dist: trusty
7575
env:
76-
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
76+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" PATTERN="slow"
7777
- dist: trusty
7878
env:
7979
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
@@ -107,20 +107,15 @@ script:
107107
- echo "script start"
108108
- source activate pandas-dev
109109
- ci/run_build_docs.sh
110-
- ci/script_single.sh
111-
- ci/script_multi.sh
112-
- ci/code_checks.sh
113-
114-
after_success:
115-
- ci/upload_coverage.sh
110+
- ci/run_tests.sh
116111

117112
after_script:
118113
- echo "after_script start"
119114
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
120115
- if [ -e test-data-single.xml ]; then
121-
ci/print_skipped.py test-data-single.xml;
116+
ci/print_skipped.py test-data-single.xml;
122117
fi
123118
- if [ -e test-data-multiple.xml ]; then
124-
ci/print_skipped.py test-data-multiple.xml;
119+
ci/print_skipped.py test-data-multiple.xml;
125120
fi
126121
- echo "after_script done"

LICENSES/MUSL_LICENSE

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
musl as a whole is licensed under the following standard MIT license:
2+
3+
----------------------------------------------------------------------
4+
Copyright © 2005-2014 Rich Felker, et al.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining
7+
a copy of this software and associated documentation files (the
8+
"Software"), to deal in the Software without restriction, including
9+
without limitation the rights to use, copy, modify, merge, publish,
10+
distribute, sublicense, and/or sell copies of the Software, and to
11+
permit persons to whom the Software is furnished to do so, subject to
12+
the following conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
----------------------------------------------------------------------
25+
26+
Authors/contributors include:
27+
28+
Anthony G. Basile
29+
Arvid Picciani
30+
Bobby Bingham
31+
Boris Brezillon
32+
Brent Cook
33+
Chris Spiegel
34+
Clément Vasseur
35+
Emil Renner Berthing
36+
Hiltjo Posthuma
37+
Isaac Dunham
38+
Jens Gustedt
39+
Jeremy Huntwork
40+
John Spencer
41+
Justin Cormack
42+
Luca Barbato
43+
Luka Perkov
44+
M Farkas-Dyck (Strake)
45+
Michael Forney
46+
Nicholas J. Kain
47+
orc
48+
Pascal Cuoq
49+
Pierre Carrier
50+
Rich Felker
51+
Richard Pennington
52+
sin
53+
Solar Designer
54+
Stefan Kristiansson
55+
Szabolcs Nagy
56+
Timo Teräs
57+
Valentin Ochs
58+
William Haddon
59+
60+
Portions of this software are derived from third-party works licensed
61+
under terms compatible with the above MIT license:
62+
63+
The TRE regular expression implementation (src/regex/reg* and
64+
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
65+
under a 2-clause BSD license (license text in the source files). The
66+
included version has been heavily modified by Rich Felker in 2012, in
67+
the interests of size, simplicity, and namespace cleanliness.
68+
69+
Much of the math library code (src/math/* and src/complex/*) is
70+
Copyright © 1993,2004 Sun Microsystems or
71+
Copyright © 2003-2011 David Schultz or
72+
Copyright © 2003-2009 Steven G. Kargl or
73+
Copyright © 2003-2009 Bruce D. Evans or
74+
Copyright © 2008 Stephen L. Moshier
75+
and labelled as such in comments in the individual source files. All
76+
have been licensed under extremely permissive terms.
77+
78+
The ARM memcpy code (src/string/armel/memcpy.s) is Copyright © 2008
79+
The Android Open Source Project and is licensed under a two-clause BSD
80+
license. It was taken from Bionic libc, used on Android.
81+
82+
The implementation of DES for crypt (src/misc/crypt_des.c) is
83+
Copyright © 1994 David Burren. It is licensed under a BSD license.
84+
85+
The implementation of blowfish crypt (src/misc/crypt_blowfish.c) was
86+
originally written by Solar Designer and placed into the public
87+
domain. The code also comes with a fallback permissive license for use
88+
in jurisdictions that may not recognize the public domain.
89+
90+
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
91+
Valentin Ochs and is licensed under an MIT-style license.
92+
93+
The BSD PRNG implementation (src/prng/random.c) and XSI search API
94+
(src/search/*.c) functions are Copyright © 2011 Szabolcs Nagy and
95+
licensed under following terms: "Permission to use, copy, modify,
96+
and/or distribute this code for any purpose with or without fee is
97+
hereby granted. There is no warranty."
98+
99+
The x86_64 port was written by Nicholas J. Kain. Several files (crt)
100+
were released into the public domain; others are licensed under the
101+
standard MIT license terms at the top of this file. See individual
102+
files for their copyright status.
103+
104+
The mips and microblaze ports were originally written by Richard
105+
Pennington for use in the ellcc project. The original code was adapted
106+
by Rich Felker for build system and code conventions during upstream
107+
integration. It is licensed under the standard MIT terms.
108+
109+
The powerpc port was also originally written by Richard Pennington,
110+
and later supplemented and integrated by John Spencer. It is licensed
111+
under the standard MIT terms.
112+
113+
All other files which have no copyright comments are original works
114+
produced specifically for use as part of this library, written either
115+
by Rich Felker, the main author of the library, or by one or more
116+
contibutors listed above. Details on authorship of individual files
117+
can be found in the git version control history of the project. The
118+
omission of copyright and license comments in each file is in the
119+
interest of source tree size.
120+
121+
All public header files (include/* and arch/*/bits/*) should be
122+
treated as Public Domain as they intentionally contain no content
123+
which can be covered by copyright. Some source modules may fall in
124+
this category as well. If you believe that a file is so trivial that
125+
it should be in the Public Domain, please contact the authors and
126+
request an explicit statement releasing it from copyright.
127+
128+
The following files are trivial, believed not to be copyrightable in
129+
the first place, and hereby explicitly released to the Public Domain:
130+
131+
All public headers: include/*, arch/*/bits/*
132+
Startup files: crt/*

asv_bench/benchmarks/algorithms.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import warnings
21
from importlib import import_module
32

43
import numpy as np
4+
55
import pandas as pd
66
from pandas.util import testing as tm
77

8+
89
for imp in ['pandas.util', 'pandas.tools.hashing']:
910
try:
1011
hashing = import_module(imp)
@@ -73,10 +74,6 @@ def setup(self):
7374
self.uniques = tm.makeStringIndex(1000).values
7475
self.all = self.uniques.repeat(10)
7576

76-
def time_match_string(self):
77-
with warnings.catch_warnings(record=True):
78-
pd.match(self.all, self.uniques)
79-
8077

8178
class Hashing(object):
8279

asv_bench/benchmarks/categoricals.py

+8
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def setup(self):
4646
self.values_some_nan = list(np.tile(self.categories + [np.nan], N))
4747
self.values_all_nan = [np.nan] * len(self.values)
4848
self.values_all_int8 = np.ones(N, 'int8')
49+
self.categorical = pd.Categorical(self.values, self.categories)
50+
self.series = pd.Series(self.categorical)
4951

5052
def time_regular(self):
5153
pd.Categorical(self.values, self.categories)
@@ -68,6 +70,12 @@ def time_all_nan(self):
6870
def time_from_codes_all_int8(self):
6971
pd.Categorical.from_codes(self.values_all_int8, self.categories)
7072

73+
def time_existing_categorical(self):
74+
pd.Categorical(self.categorical)
75+
76+
def time_existing_series(self):
77+
pd.Categorical(self.series)
78+
7179

7280
class ValueCounts(object):
7381

asv_bench/benchmarks/frame_methods.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import string
2-
import warnings
32

43
import numpy as np
4+
5+
from pandas import (
6+
DataFrame, MultiIndex, NaT, Series, date_range, isnull, period_range)
57
import pandas.util.testing as tm
6-
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
7-
isnull, NaT)
88

99

1010
class GetNumericData(object):
@@ -13,8 +13,7 @@ def setup(self):
1313
self.df = DataFrame(np.random.randn(10000, 25))
1414
self.df['foo'] = 'bar'
1515
self.df['bar'] = 'baz'
16-
with warnings.catch_warnings(record=True):
17-
self.df = self.df.consolidate()
16+
self.df = self.df._consolidate()
1817

1918
def time_frame_get_numeric_data(self):
2019
self.df._get_numeric_data()
@@ -62,9 +61,6 @@ def time_reindex_axis1(self):
6261
def time_reindex_both_axes(self):
6362
self.df.reindex(index=self.idx, columns=self.idx)
6463

65-
def time_reindex_both_axes_ix(self):
66-
self.df.ix[self.idx, self.idx]
67-
6864
def time_reindex_upcast(self):
6965
self.df2.reindex(np.random.permutation(range(1200)))
7066

asv_bench/benchmarks/groupby.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import warnings
2-
from string import ascii_letters
3-
from itertools import product
41
from functools import partial
2+
from itertools import product
3+
from string import ascii_letters
4+
import warnings
55

66
import numpy as np
7-
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
8-
TimeGrouper, Categorical, Timestamp)
7+
8+
from pandas import (
9+
Categorical, DataFrame, MultiIndex, Series, TimeGrouper, Timestamp,
10+
date_range, period_range)
911
import pandas.util.testing as tm
1012

1113

@@ -210,7 +212,7 @@ def time_multi_int_nunique(self, df):
210212

211213
class AggFunctions(object):
212214

213-
def setup_cache():
215+
def setup_cache(self):
214216
N = 10**5
215217
fac1 = np.array(['A', 'B', 'C'], dtype='O')
216218
fac2 = np.array(['one', 'two'], dtype='O')
@@ -471,8 +473,8 @@ def setup(self):
471473
n1 = 400
472474
n2 = 250
473475
index = MultiIndex(levels=[np.arange(n1), tm.makeStringIndex(n2)],
474-
labels=[np.repeat(range(n1), n2).tolist(),
475-
list(range(n2)) * n1],
476+
codes=[np.repeat(range(n1), n2).tolist(),
477+
list(range(n2)) * n1],
476478
names=['lev1', 'lev2'])
477479
arr = np.random.randn(n1 * n2, 3)
478480
arr[::10000, 0] = np.nan

asv_bench/benchmarks/join_merge.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ def setup(self):
2323
self.mdf1['obj1'] = 'bar'
2424
self.mdf1['obj2'] = 'bar'
2525
self.mdf1['int1'] = 5
26-
try:
27-
with warnings.catch_warnings(record=True):
28-
self.mdf1.consolidate(inplace=True)
29-
except (AttributeError, TypeError):
30-
pass
26+
self.mdf1 = self.mdf1._consolidate()
3127
self.mdf2 = self.mdf1.copy()
3228
self.mdf2.index = self.df2.index
3329

@@ -119,16 +115,16 @@ class Join(object):
119115
def setup(self, sort):
120116
level1 = tm.makeStringIndex(10).values
121117
level2 = tm.makeStringIndex(1000).values
122-
label1 = np.arange(10).repeat(1000)
123-
label2 = np.tile(np.arange(1000), 10)
118+
codes1 = np.arange(10).repeat(1000)
119+
codes2 = np.tile(np.arange(1000), 10)
124120
index2 = MultiIndex(levels=[level1, level2],
125-
labels=[label1, label2])
121+
codes=[codes1, codes2])
126122
self.df_multi = DataFrame(np.random.randn(len(index2), 4),
127123
index=index2,
128124
columns=['A', 'B', 'C', 'D'])
129125

130-
self.key1 = np.tile(level1.take(label1), 10)
131-
self.key2 = np.tile(level2.take(label2), 10)
126+
self.key1 = np.tile(level1.take(codes1), 10)
127+
self.key2 = np.tile(level2.take(codes2), 10)
132128
self.df = DataFrame({'data1': np.random.randn(100000),
133129
'data2': np.random.randn(100000),
134130
'key1': self.key1,

asv_bench/benchmarks/multiindex_object.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def setup(self):
7979
levels = [np.arange(n),
8080
tm.makeStringIndex(n).values,
8181
1000 + np.arange(n)]
82-
labels = [np.random.choice(n, (k * n)) for lev in levels]
83-
self.mi = MultiIndex(levels=levels, labels=labels)
82+
codes = [np.random.choice(n, (k * n)) for lev in levels]
83+
self.mi = MultiIndex(levels=levels, codes=codes)
8484

8585
def time_duplicated(self):
8686
self.mi.duplicated()

asv_bench/benchmarks/period.py

+4
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ class PeriodIndexConstructor(object):
4343
def setup(self, freq):
4444
self.rng = date_range('1985', periods=1000)
4545
self.rng2 = date_range('1985', periods=1000).to_pydatetime()
46+
self.ints = list(range(2000, 3000))
4647

4748
def time_from_date_range(self, freq):
4849
PeriodIndex(self.rng, freq=freq)
4950

5051
def time_from_pydatetime(self, freq):
5152
PeriodIndex(self.rng2, freq=freq)
5253

54+
def time_from_ints(self, freq):
55+
PeriodIndex(self.ints, freq=freq)
56+
5357

5458
class DataFramePeriodColumn(object):
5559

0 commit comments

Comments
 (0)