Skip to content

Commit 6da7805

Browse files
authored
Merge branch 'master' into ndarray_tolerance
2 parents f21c722 + 36dadd7 commit 6da7805

File tree

168 files changed

+4348
-3393
lines changed

Some content is hidden

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

168 files changed

+4348
-3393
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88

99
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution.]
1010

11-
**Note**: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before.
12-
Please check first before submitting so that we do not have to handle and close duplicates!
11+
**Note**: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
1312

14-
**Note**: Many problems can be resolved by simply upgrading `pandas` to the latest version. Before submitting, please check
15-
if that solution works for you. If possible, you may want to check if `master` addresses this issue, but that is not necessary.
13+
**Note**: Many problems can be resolved by simply upgrading `pandas` to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if `master` addresses this issue, but that is not necessary.
14+
15+
For documentation-related issues, you can check the latest versions of the docs on `master` here:
16+
17+
https://pandas-docs.github.io/pandas-docs-travis/
18+
19+
If the issue has not been resolved there, go ahead and file it in the issue tracker.
1620

1721
#### Expected Output
1822

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] closes #xxxx
2-
- [ ] tests added / passed
3-
- [ ] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
4-
- [ ] whatsnew entry
1+
- [ ] closes #xxxx
2+
- [ ] tests added / passed
3+
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
4+
- [ ] whatsnew entry

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ matrix:
3737
- JOB="3.5_OSX" TEST_ARGS="--skip-slow --skip-network"
3838
- dist: trusty
3939
env:
40-
- JOB="2.7_LOCALE" TEST_ARGS="--only-slow --skip-network" LOCALE_OVERRIDE="zh_CN.UTF-8"
40+
- JOB="2.7_LOCALE" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
4141
addons:
4242
apt:
4343
packages:
@@ -62,7 +62,7 @@ matrix:
6262
# In allow_failures
6363
- dist: trusty
6464
env:
65-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
65+
- JOB="2.7_SLOW" SLOW=true
6666
# In allow_failures
6767
- dist: trusty
6868
env:
@@ -82,7 +82,7 @@ matrix:
8282
allow_failures:
8383
- dist: trusty
8484
env:
85-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
85+
- JOB="2.7_SLOW" SLOW=true
8686
- dist: trusty
8787
env:
8888
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ install:
7272
- cmd: conda info -a
7373

7474
# create our env
75-
- cmd: conda create -n pandas python=%PYTHON_VERSION% cython pytest pytest-xdist
75+
- cmd: conda create -n pandas python=%PYTHON_VERSION% cython pytest>=3.1.0 pytest-xdist
7676
- cmd: activate pandas
7777
- SET REQ=ci\requirements-%PYTHON_VERSION%_WIN.run
7878
- cmd: echo "installing requirements from %REQ%"

asv_bench/asv.conf.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@
117117
// with results. If the commit is `null`, regression detection is
118118
// skipped for the matching benchmark.
119119
//
120-
// "regressions_first_commits": {
121-
// "some_benchmark": "352cdf", // Consider regressions only after this commit
122-
// "another_benchmark": null, // Skip regression detection altogether
123-
// }
120+
"regressions_first_commits": {
121+
".*": "v0.20.0"
122+
},
123+
"regression_thresholds": {
124+
".*": 0.05
125+
}
124126
}

asv_bench/benchmarks/stat_ops.py

Lines changed: 22 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,36 @@
11
from .pandas_vb_common import *
22

33

4-
class stat_ops_frame_mean_float_axis_0(object):
5-
goal_time = 0.2
6-
7-
def setup(self):
8-
self.df = DataFrame(np.random.randn(100000, 4))
9-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
10-
11-
def time_stat_ops_frame_mean_float_axis_0(self):
12-
self.df.mean()
13-
14-
15-
class stat_ops_frame_mean_float_axis_1(object):
16-
goal_time = 0.2
17-
18-
def setup(self):
19-
self.df = DataFrame(np.random.randn(100000, 4))
20-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
21-
22-
def time_stat_ops_frame_mean_float_axis_1(self):
23-
self.df.mean(1)
24-
25-
26-
class stat_ops_frame_mean_int_axis_0(object):
27-
goal_time = 0.2
28-
29-
def setup(self):
30-
self.df = DataFrame(np.random.randn(100000, 4))
31-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
32-
33-
def time_stat_ops_frame_mean_int_axis_0(self):
34-
self.dfi.mean()
35-
36-
37-
class stat_ops_frame_mean_int_axis_1(object):
38-
goal_time = 0.2
4+
def _set_use_bottleneck_False():
5+
try:
6+
pd.options.compute.use_bottleneck = False
7+
except:
8+
from pandas.core import nanops
9+
nanops._USE_BOTTLENECK = False
3910

40-
def setup(self):
41-
self.df = DataFrame(np.random.randn(100000, 4))
42-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
43-
44-
def time_stat_ops_frame_mean_int_axis_1(self):
45-
self.dfi.mean(1)
46-
47-
48-
class stat_ops_frame_sum_float_axis_0(object):
49-
goal_time = 0.2
5011

51-
def setup(self):
52-
self.df = DataFrame(np.random.randn(100000, 4))
53-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
54-
55-
def time_stat_ops_frame_sum_float_axis_0(self):
56-
self.df.sum()
57-
58-
59-
class stat_ops_frame_sum_float_axis_1(object):
12+
class FrameOps(object):
6013
goal_time = 0.2
6114

62-
def setup(self):
63-
self.df = DataFrame(np.random.randn(100000, 4))
64-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
15+
param_names = ['op', 'use_bottleneck', 'dtype', 'axis']
16+
params = [['mean', 'sum', 'median'],
17+
[True, False],
18+
['float', 'int'],
19+
[0, 1]]
6520

66-
def time_stat_ops_frame_sum_float_axis_1(self):
67-
self.df.sum(1)
21+
def setup(self, op, use_bottleneck, dtype, axis):
22+
if dtype == 'float':
23+
self.df = DataFrame(np.random.randn(100000, 4))
24+
elif dtype == 'int':
25+
self.df = DataFrame(np.random.randint(1000, size=(100000, 4)))
6826

27+
if not use_bottleneck:
28+
_set_use_bottleneck_False()
6929

70-
class stat_ops_frame_sum_int_axis_0(object):
71-
goal_time = 0.2
72-
73-
def setup(self):
74-
self.df = DataFrame(np.random.randn(100000, 4))
75-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
76-
77-
def time_stat_ops_frame_sum_int_axis_0(self):
78-
self.dfi.sum()
79-
80-
81-
class stat_ops_frame_sum_int_axis_1(object):
82-
goal_time = 0.2
83-
84-
def setup(self):
85-
self.df = DataFrame(np.random.randn(100000, 4))
86-
self.dfi = DataFrame(np.random.randint(1000, size=self.df.shape))
30+
self.func = getattr(self.df, op)
8731

88-
def time_stat_ops_frame_sum_int_axis_1(self):
89-
self.dfi.sum(1)
32+
def time_op(self, op, use_bottleneck, dtype, axis):
33+
self.func(axis=axis)
9034

9135

9236
class stat_ops_level_frame_sum(object):

asv_bench/benchmarks/timeseries.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,17 @@ def time_begin_incr_rng(self):
510510

511511
def time_begin_decr_rng(self):
512512
self.rng - self.semi_month_begin
513+
514+
515+
class DatetimeAccessor(object):
516+
def setup(self):
517+
self.N = 100000
518+
self.series = pd.Series(
519+
pd.date_range(start='1/1/2000', periods=self.N, freq='T')
520+
)
521+
522+
def time_dt_accessor(self):
523+
self.series.dt
524+
525+
def time_dt_accessor_normalize(self):
526+
self.series.dt.normalize()

ci/install_circle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fi
6464
# create envbuild deps
6565
echo "[create env: ${REQ_BUILD}]"
6666
time conda create -n pandas -q --file=${REQ_BUILD} || exit 1
67-
time conda install -n pandas pytest || exit 1
67+
time conda install -n pandas pytest>=3.1.0 || exit 1
6868

6969
source activate pandas
7070

ci/install_travis.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ which conda
4747
echo
4848
echo "[update conda]"
4949
conda config --set ssl_verify false || exit 1
50-
conda config --set always_yes true --set changeps1 false || exit 1
50+
conda config --set quiet true --set always_yes true --set changeps1 false || exit 1
5151
conda update -q conda
5252

5353
echo
@@ -103,7 +103,7 @@ if [ -e ${REQ} ]; then
103103
time bash $REQ || exit 1
104104
fi
105105

106-
time conda install -n pandas pytest
106+
time conda install -n pandas pytest>=3.1.0
107107
time pip install pytest-xdist
108108

109109
if [ "$LINT" ]; then

ci/requirements-2.7_COMPAT.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
2-
numpy=1.7.1
2+
numpy=1.9.2
33
cython=0.23
44
dateutil=1.5
55
pytz=2013b

ci/requirements-2.7_COMPAT.run

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
numpy=1.7.1
1+
numpy=1.9.2
22
dateutil=1.5
33
pytz=2013b
4-
scipy=0.11.0
4+
scipy=0.14.0
55
xlwt=0.7.5
66
xlrd=0.9.2
7-
numexpr=2.2.2
8-
pytables=3.0.0
7+
bottleneck=1.0.0
8+
numexpr=2.4.4 # we test that we correctly don't use an unsupported numexpr
9+
pytables=3.2.2
910
psycopg2
1011
pymysql=0.6.0
1112
sqlalchemy=0.7.8

ci/requirements-2.7_LOCALE.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
22
python-dateutil
33
pytz=2013b
4-
numpy=1.8.2
4+
numpy=1.9.2
55
cython=0.23

ci/requirements-2.7_LOCALE.run

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
python-dateutil
22
pytz=2013b
3-
numpy=1.8.2
3+
numpy=1.9.2
44
xlwt=0.7.5
55
openpyxl=1.6.2
66
xlsxwriter=0.5.2
77
xlrd=0.9.2
8-
matplotlib=1.3.1
8+
bottleneck=1.0.0
9+
matplotlib=1.4.3
910
sqlalchemy=0.8.1
1011
lxml=3.2.1
1112
scipy

ci/requirements-2.7_SLOW.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
22
python-dateutil
33
pytz
4-
numpy=1.8.2
4+
numpy=1.10*
55
cython

ci/requirements-2.7_SLOW.run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
python-dateutil
22
pytz
3-
numpy=1.8.2
4-
matplotlib=1.3.1
3+
numpy=1.10*
4+
matplotlib=1.4.3
55
scipy
66
patsy
77
xlwt

ci/requirements_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest
1+
pytest>=3.1.0
22
pytest-cov
33
pytest-xdist
44
flake8

ci/requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ python-dateutil
22
pytz
33
numpy
44
cython
5-
pytest
5+
pytest>=3.1.0
66
pytest-cov
77
flake8

ci/script_multi.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ elif [ "$COVERAGE" ]; then
3636
echo pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
3737
pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
3838

39+
elif [ "$SLOW" ]; then
40+
TEST_ARGS="--only-slow --skip-network"
41+
echo pytest -r xX -m "not single and slow" -v --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
42+
pytest -r xX -m "not single and slow" -v --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
43+
3944
else
4045
echo pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
4146
pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas # TODO: doctest
47+
4248
fi
4349

4450
RET="$?"

ci/script_single.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,24 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
1212
python -c "$pycmd"
1313
fi
1414

15+
if [ "$SLOW" ]; then
16+
TEST_ARGS="--only-slow --skip-network"
17+
fi
18+
1519
if [ "$BUILD_TEST" ]; then
1620
echo "We are not running pytest as this is a build test."
21+
1722
elif [ "$DOC" ]; then
1823
echo "We are not running pytest as this is a doc-build"
24+
1925
elif [ "$COVERAGE" ]; then
2026
echo pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
2127
pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
28+
2229
else
2330
echo pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas
2431
pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas # TODO: doctest
32+
2533
fi
2634

2735
RET="$?"

doc/source/api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ Feather
109109

110110
read_feather
111111

112+
Parquet
113+
~~~~~~~
114+
115+
.. autosummary::
116+
:toctree: generated/
117+
118+
read_parquet
119+
112120
SAS
113121
~~~
114122

0 commit comments

Comments
 (0)