Skip to content

Commit ad640f1

Browse files
Merge branch 'master' into fix-15582
2 parents 30cb09b + be2dad1 commit ad640f1

File tree

329 files changed

+7981
-6115
lines changed

Some content is hidden

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

329 files changed

+7981
-6115
lines changed

.travis.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ language: python
88
# The cash directories will be deleted if anything in ci/ changes in a commit
99
cache:
1010
directories:
11-
- $HOME/miniconda # miniconda cache
1211
- $HOME/.cache # cython cache
1312
- $HOME/.ccache # compiler cache
1413

@@ -75,7 +74,7 @@ matrix:
7574
- CLIPBOARD=xsel
7675
- COVERAGE=true
7776
- CACHE_NAME="35_nslow"
78-
# - USE_CACHE=true # Don't use cache for 35_nslow
77+
- USE_CACHE=true
7978
addons:
8079
apt:
8180
packages:
@@ -86,6 +85,8 @@ matrix:
8685
- JOB_NAME: "36"
8786
- TEST_ARGS="--skip-slow --skip-network"
8887
- PANDAS_TESTING_MODE="deprecate"
88+
- CONDA_FORGE=true
89+
- USE_CACHE=true
8990
addons:
9091
apt:
9192
packages:
@@ -122,11 +123,6 @@ matrix:
122123
- PANDAS_TESTING_MODE="deprecate"
123124
- CACHE_NAME="35_numpy_dev"
124125
- USE_CACHE=true
125-
addons:
126-
apt:
127-
packages:
128-
- libatlas-base-dev
129-
- gfortran
130126
# In allow_failures
131127
- python: 3.5
132128
env:
@@ -159,18 +155,13 @@ matrix:
159155
- USE_CACHE=true
160156
- python: 3.5
161157
env:
162-
- PYTHON_VERSION=3.5
163-
- JOB_NAME: "35_numpy_dev"
164-
- JOB_TAG=_NUMPY_DEV
165-
- TEST_ARGS="--skip-slow --skip-network"
166-
- PANDAS_TESTING_MODE="deprecate"
167-
- CACHE_NAME="35_numpy_dev"
168-
- USE_CACHE=true
169-
addons:
170-
apt:
171-
packages:
172-
- libatlas-base-dev
173-
- gfortran
158+
- PYTHON_VERSION=3.5
159+
- JOB_NAME: "35_numpy_dev"
160+
- JOB_TAG=_NUMPY_DEV
161+
- TEST_ARGS="--skip-slow --skip-network"
162+
- PANDAS_TESTING_MODE="deprecate"
163+
- CACHE_NAME="35_numpy_dev"
164+
- USE_CACHE=true
174165
- python: 3.5
175166
env:
176167
- PYTHON_VERSION=3.5

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tseries: pandas/lib.pyx pandas/tslib.pyx pandas/hashtable.pyx
1+
tseries: pandas/_libs/lib.pyx pandas/_libs/tslib.pyx pandas/_libs/hashtable.pyx
22
python setup.py build_ext --inplace
33

44
.PHONY : develop build clean clean_pyc tseries doc
@@ -9,9 +9,6 @@ clean:
99
clean_pyc:
1010
-find . -name '*.py[co]' -exec rm {} \;
1111

12-
sparse: pandas/src/sparse.pyx
13-
python setup.py build_ext --inplace
14-
1512
build: clean_pyc
1613
python setup.py build_ext --inplace
1714

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<tr>
4242
<td></td>
4343
<td>
44-
<a href="https://ci.appveyor.com/project/jreback/pandas-465">
45-
<img src="https://ci.appveyor.com/api/projects/status/iblk29s98quexwxi/branch/master?svg=true" alt="appveyor build status" />
44+
<a href="https://ci.appveyor.com/project/pandas-dev/pandas">
45+
<img src="https://ci.appveyor.com/api/projects/status/86vn83mxgnl4xf1s/branch/master?svg=true" alt="appveyor build status" />
4646
</a>
4747
</td>
4848
</tr>
@@ -54,7 +54,15 @@
5454
<td>Conda</td>
5555
<td>
5656
<a href="http://pandas.pydata.org">
57-
<img src="http://pubbadges.s3-website-us-east-1.amazonaws.com/pkgs-downloads-pandas.png" alt="conda downloads" />
57+
<img src="http://pubbadges.s3-website-us-east-1.amazonaws.com/pkgs-downloads-pandas.png" alt="conda default downloads" />
58+
</a>
59+
</td>
60+
</tr>
61+
<tr>
62+
<td>Conda-forge</td>
63+
<td>
64+
<a href="http://pandas.pydata.org">
65+
<img src="https://anaconda.org/conda-forge/pandas/badges/downloads.svg" alt="conda-forge downloads" />
5866
</a>
5967
</td>
6068
</tr>

asv_bench/benchmarks/binary_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ def setup(self):
107107
self.s = Series(date_range('20010101', periods=self.N, freq='T', tz='US/Eastern'))
108108
self.ts = self.s[self.halfway]
109109

110-
self.s2 = Series(date_range('20010101', periods=self.N, freq='s', tz='US/Eastern'))
110+
self.s2 = Series(date_range('20010101', periods=self.N, freq='s', tz='US/Eastern'))

asv_bench/benchmarks/join_merge.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pandas import ordered_merge as merge_ordered
77

88

9-
#----------------------------------------------------------------------
9+
# ----------------------------------------------------------------------
1010
# Append
1111

1212
class Append(object):
@@ -35,7 +35,7 @@ def time_append_mixed(self):
3535
self.mdf1.append(self.mdf2)
3636

3737

38-
#----------------------------------------------------------------------
38+
# ----------------------------------------------------------------------
3939
# Concat
4040

4141
class Concat(object):
@@ -120,7 +120,7 @@ def time_f_ordered_axis1(self):
120120
concat(self.frames_f, axis=1, ignore_index=True)
121121

122122

123-
#----------------------------------------------------------------------
123+
# ----------------------------------------------------------------------
124124
# Joins
125125

126126
class Join(object):
@@ -202,7 +202,7 @@ def time_join_non_unique_equal(self):
202202
(self.fracofday * self.temp[self.fracofday.index])
203203

204204

205-
#----------------------------------------------------------------------
205+
# ----------------------------------------------------------------------
206206
# Merges
207207

208208
class Merge(object):
@@ -257,7 +257,31 @@ def time_i8merge(self):
257257
merge(self.left, self.right, how='outer')
258258

259259

260-
#----------------------------------------------------------------------
260+
class MergeCategoricals(object):
261+
goal_time = 0.2
262+
263+
def setup(self):
264+
self.left_object = pd.DataFrame(
265+
{'X': np.random.choice(range(0, 10), size=(10000,)),
266+
'Y': np.random.choice(['one', 'two', 'three'], size=(10000,))})
267+
268+
self.right_object = pd.DataFrame(
269+
{'X': np.random.choice(range(0, 10), size=(10000,)),
270+
'Z': np.random.choice(['jjj', 'kkk', 'sss'], size=(10000,))})
271+
272+
self.left_cat = self.left_object.assign(
273+
Y=self.left_object['Y'].astype('category'))
274+
self.right_cat = self.right_object.assign(
275+
Z=self.right_object['Z'].astype('category'))
276+
277+
def time_merge_object(self):
278+
merge(self.left_object, self.right_object, on='X')
279+
280+
def time_merge_cat(self):
281+
merge(self.left_cat, self.right_cat, on='X')
282+
283+
284+
# ----------------------------------------------------------------------
261285
# Ordered merge
262286

263287
class MergeOrdered(object):
@@ -332,7 +356,7 @@ def time_multiby(self):
332356
merge_asof(self.df1e, self.df2e, on='time', by=['key', 'key2'])
333357

334358

335-
#----------------------------------------------------------------------
359+
# ----------------------------------------------------------------------
336360
# data alignment
337361

338362
class Align(object):

asv_bench/benchmarks/pandas_vb_common.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@
88
import random
99
import numpy as np
1010
import threading
11+
from importlib import import_module
12+
1113
try:
1214
from pandas.compat import range
1315
except ImportError:
1416
pass
1517

1618
np.random.seed(1234)
17-
try:
18-
import pandas._tseries as lib
19-
except:
20-
import pandas.lib as lib
19+
20+
# try em until it works!
21+
for imp in ['pandas_tseries', 'pandas.lib', 'pandas._libs.lib']:
22+
try:
23+
lib = import_module(imp)
24+
break
25+
except:
26+
pass
2127

2228
try:
2329
Panel = Panel

asv_bench/benchmarks/panel_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ def time_shift(self):
2121
self.panel.shift(1)
2222

2323
def time_shift_minor(self):
24-
self.panel.shift(1, axis='minor')
24+
self.panel.shift(1, axis='minor')

asv_bench/benchmarks/reshape.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ def time_reshape_unstack_simple(self):
5959
self.df.unstack(1)
6060

6161

62+
class reshape_unstack_large_single_dtype(object):
63+
goal_time = 0.2
64+
65+
def setup(self):
66+
m = 100
67+
n = 1000
68+
69+
levels = np.arange(m)
70+
index = pd.MultiIndex.from_product([levels]*2)
71+
columns = np.arange(n)
72+
values = np.arange(m*m*n).reshape(m*m, n)
73+
self.df = pd.DataFrame(values, index, columns)
74+
self.df2 = self.df.iloc[:-1]
75+
76+
def time_unstack_full_product(self):
77+
self.df.unstack()
78+
79+
def time_unstack_with_mask(self):
80+
self.df2.unstack()
81+
82+
6283
class unstack_sparse_keyspace(object):
6384
goal_time = 0.2
6485

asv_bench/benchmarks/series_methods.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def setup(self):
6868
self.s4 = self.s3.astype('object')
6969

7070
def time_series_nlargest1(self):
71-
self.s1.nlargest(3, take_last=True)
72-
self.s1.nlargest(3, take_last=False)
71+
self.s1.nlargest(3, keep='last')
72+
self.s1.nlargest(3, keep='first')
7373

7474

7575
class series_nlargest2(object):
@@ -83,8 +83,8 @@ def setup(self):
8383
self.s4 = self.s3.astype('object')
8484

8585
def time_series_nlargest2(self):
86-
self.s2.nlargest(3, take_last=True)
87-
self.s2.nlargest(3, take_last=False)
86+
self.s2.nlargest(3, keep='last')
87+
self.s2.nlargest(3, keep='first')
8888

8989

9090
class series_nsmallest2(object):
@@ -98,8 +98,8 @@ def setup(self):
9898
self.s4 = self.s3.astype('object')
9999

100100
def time_series_nsmallest2(self):
101-
self.s2.nsmallest(3, take_last=True)
102-
self.s2.nsmallest(3, take_last=False)
101+
self.s2.nsmallest(3, keep='last')
102+
self.s2.nsmallest(3, keep='first')
103103

104104

105105
class series_dropna_int64(object):

ci/build_docs.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ if [ x"$DOC_BUILD" != x"" ]; then
2323

2424
source activate pandas
2525

26-
# install sudo deps
27-
time sudo apt-get $APT_ARGS install dvipng texlive-latex-base texlive-latex-extra
28-
2926
mv "$TRAVIS_BUILD_DIR"/doc /tmp
3027
cd /tmp/doc
3128

ci/check_cache.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ else
1212
ci_changes=$(git diff PR_HEAD~2 --numstat | grep -E "ci/"| wc -l)
1313
fi
1414

15-
MINICONDA_DIR="$HOME/miniconda/"
1615
CACHE_DIR="$HOME/.cache/"
1716
CCACHE_DIR="$HOME/.ccache/"
1817

1918
if [ $ci_changes -ne 0 ]
2019
then
2120
echo "Files have changed in ci/ deleting all caches"
22-
rm -rf "$MINICONDA_DIR"
2321
rm -rf "$CACHE_DIR"
2422
rm -rf "$CCACHE_DIR"
25-
fi
23+
fi

ci/install_travis.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,53 @@ edit_init
3232
home_dir=$(pwd)
3333
echo "[home_dir: $home_dir]"
3434

35+
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
36+
echo "[install ccache]"
37+
time brew install ccache
38+
fi
39+
3540
# install miniconda
41+
MINICONDA_DIR="$HOME/miniconda3"
42+
3643
echo "[Using clean Miniconda install]"
3744

38-
MINICONDA_DIR="$HOME/miniconda3"
3945
if [ -d "$MINICONDA_DIR" ]; then
4046
rm -rf "$MINICONDA_DIR"
4147
fi
4248

4349
# install miniconda
4450
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
45-
wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1
51+
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1
4652
else
47-
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || exit 1
53+
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || exit 1
4854
fi
49-
bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
55+
time bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
56+
57+
echo "[show conda]"
58+
which conda
5059

5160
echo "[update conda]"
5261
conda config --set ssl_verify false || exit 1
5362
conda config --set always_yes true --set changeps1 false || exit 1
5463
conda update -q conda
5564

65+
echo "[add channels]"
5666
# add the pandas channel to take priority
5767
# to add extra packages
58-
echo "[add channels]"
5968
conda config --add channels pandas || exit 1
6069
conda config --remove channels defaults || exit 1
6170
conda config --add channels defaults || exit 1
6271

63-
conda install anaconda-client
72+
if [ "$CONDA_FORGE" ]; then
73+
# add conda-forge channel as priority
74+
conda config --add channels conda-forge || exit 1
75+
fi
6476

6577
# Useful for debugging any issues with conda
6678
conda info -a || exit 1
6779

6880
# set the compiler cache to work
69-
if [ "$USE_CACHE" ] && "${TRAVIS_OS_NAME}" == "linux" ]; then
81+
if [ "$USE_CACHE" ] && [ "${TRAVIS_OS_NAME}" == "linux" ]; then
7082
echo "[Using ccache]"
7183
export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH
7284
gcc=$(which gcc)
@@ -78,13 +90,16 @@ else
7890
echo "[Not using ccache]"
7991
fi
8092

93+
echo "[create env]"
94+
8195
# may have installation instructions for this build
8296
INSTALL="ci/install-${PYTHON_VERSION}${JOB_TAG}.sh"
8397
if [ -e ${INSTALL} ]; then
8498
time bash $INSTALL || exit 1
8599
else
86100
# create new env
87-
time conda create -n pandas python=$PYTHON_VERSION pytest || exit 1
101+
# this may already exists, in which case our caching worked
102+
time conda create -n pandas python=$PYTHON_VERSION pytest nomkl
88103
fi
89104

90105
# build deps

0 commit comments

Comments
 (0)