Skip to content

Commit 9b20caa

Browse files
committed
Merge remote-tracking branch 'pandas-dev/master'
2 parents b977615 + 61f6f63 commit 9b20caa

File tree

114 files changed

+5986
-4285
lines changed

Some content is hidden

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

114 files changed

+5986
-4285
lines changed

.travis.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ matrix:
8686
- JOB_NAME: "36"
8787
- TEST_ARGS="--skip-slow --skip-network"
8888
- PANDAS_TESTING_MODE="deprecate"
89+
- CONDA_FORGE=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:
@@ -166,11 +162,6 @@ matrix:
166162
- PANDAS_TESTING_MODE="deprecate"
167163
- CACHE_NAME="35_numpy_dev"
168164
- USE_CACHE=true
169-
addons:
170-
apt:
171-
packages:
172-
- libatlas-base-dev
173-
- gfortran
174165
- python: 3.5
175166
env:
176167
- PYTHON_VERSION=3.5

README.md

+2-2
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>

asv_bench/benchmarks/join_merge.py

+30-6
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):

ci/build_docs.sh

-3
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/install_travis.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ conda config --set ssl_verify false || exit 1
5353
conda config --set always_yes true --set changeps1 false || exit 1
5454
conda update -q conda
5555

56+
echo "[add channels]"
5657
# add the pandas channel to take priority
5758
# to add extra packages
58-
echo "[add channels]"
5959
conda config --add channels pandas || exit 1
6060
conda config --remove channels defaults || exit 1
6161
conda config --add channels defaults || exit 1
6262

63-
conda install anaconda-client
63+
if [ "$CONDA_FORGE" ]; then
64+
# add conda-forge channel as priority
65+
conda config --add channels conda-forge || exit 1
66+
fi
6467

6568
# Useful for debugging any issues with conda
6669
conda info -a || exit 1

ci/lint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RET=0
88

99
if [ "$LINT" ]; then
1010

11-
# pandas/src is C code, so no need to search there.
11+
# pandas/_libs/src is C code, so no need to search there.
1212
echo "Linting *.py"
13-
flake8 pandas --filename=*.py --exclude pandas/src
13+
flake8 pandas --filename=*.py --exclude pandas/_libs/src
1414
if [ $? -ne "0" ]; then
1515
RET=1
1616
fi
@@ -46,8 +46,8 @@ if [ "$LINT" ]; then
4646
echo "Linting *.c and *.h"
4747
for path in '*.h' 'period_helper.c' 'datetime' 'parser' 'ujson'
4848
do
49-
echo "linting -> pandas/src/$path"
50-
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/src/$path
49+
echo "linting -> pandas/_libs/src/$path"
50+
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/_libs/src/$path
5151
if [ $? -ne "0" ]; then
5252
RET=1
5353
fi

ci/requirements-3.5_NUMPY_DEV.build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ echo "install numpy master wheel"
88
pip uninstall numpy -y
99

1010
# install numpy wheel from master
11-
pip install --pre --upgrade --no-index --timeout=60 --trusted-host travis-dev-wheels.scipy.org -f http://travis-dev-wheels.scipy.org/ numpy scipy
11+
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
12+
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS numpy scipy
1213

1314
true

ci/requirements-3.6.run

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ html5lib
1414
jinja2
1515
sqlalchemy
1616
pymysql
17+
feather-format
1718
# psycopg2 (not avail on defaults ATM)
1819
beautifulsoup4
1920
s3fs

ci/requirements-3.6.sh

-7
This file was deleted.

ci/requirements_dev.txt

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ numpy
44
cython
55
pytest
66
pytest-cov
7-
pytest-xdist
87
flake8

doc/make.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def html():
197197
print(e)
198198
print("Failed to convert %s" % nb)
199199

200-
if os.system('sphinx-build -j 2 -P -b html -d build/doctrees '
200+
if os.system('sphinx-build -P -b html -d build/doctrees '
201201
'source build/html'):
202202
raise SystemExit("Building HTML failed.")
203203
try:

doc/source/api.rst

+11-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ Google BigQuery
118118
:toctree: generated/
119119

120120
read_gbq
121-
to_gbq
122121

123122

124123
.. currentmodule:: pandas
@@ -712,8 +711,8 @@ Serialization / IO / Conversion
712711
Series.to_string
713712
Series.to_clipboard
714713

715-
Sparse methods
716-
~~~~~~~~~~~~~~
714+
Sparse
715+
~~~~~~
717716
.. autosummary::
718717
:toctree: generated/
719718

@@ -1031,6 +1030,13 @@ Serialization / IO / Conversion
10311030
DataFrame.to_string
10321031
DataFrame.to_clipboard
10331032

1033+
Sparse
1034+
~~~~~~
1035+
.. autosummary::
1036+
:toctree: generated/
1037+
1038+
SparseDataFrame.to_coo
1039+
10341040
.. _api.panel:
10351041

10361042
Panel
@@ -1237,7 +1243,7 @@ Serialization / IO / Conversion
12371243
Panel.to_frame
12381244
Panel.to_xarray
12391245
Panel.to_clipboard
1240-
1246+
12411247
.. _api.index:
12421248

12431249
Index
@@ -1405,6 +1411,7 @@ MultiIndex
14051411
:toctree: generated/
14061412

14071413
MultiIndex
1414+
IndexSlice
14081415

14091416
MultiIndex Components
14101417
~~~~~~~~~~~~~~~~~~~~~~

doc/source/categorical.rst

+4
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ Assigning a `Categorical` to parts of a column of other types will use the value
617617
df
618618
df.dtypes
619619
620+
.. _categorical.merge:
620621

621622
Merging
622623
~~~~~~~
@@ -646,6 +647,9 @@ In this case the categories are not the same and so an error is raised:
646647
647648
The same applies to ``df.append(df_different)``.
648649

650+
See also the section on :ref:`merge dtypes<merging.dtypes>` for notes about preserving merge dtypes and performance.
651+
652+
649653
.. _categorical.union:
650654

651655
Unioning

doc/source/conf.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
import inspect
1717
from pandas.compat import u, PY3
1818

19+
# https://github.com/sphinx-doc/sphinx/pull/2325/files
20+
# Workaround for sphinx-build recursion limit overflow:
21+
# pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
22+
# RuntimeError: maximum recursion depth exceeded while pickling an object
23+
#
24+
# Python's default allowed recursion depth is 1000.
25+
sys.setrecursionlimit(5000)
26+
1927
# If extensions (or modules to document with autodoc) are in another directory,
2028
# add these directories to sys.path here. If the directory is relative to the
2129
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -46,7 +54,7 @@
4654
'ipython_sphinxext.ipython_console_highlighting',
4755
'sphinx.ext.intersphinx',
4856
'sphinx.ext.coverage',
49-
'sphinx.ext.pngmath',
57+
'sphinx.ext.mathjax',
5058
'sphinx.ext.ifconfig',
5159
'sphinx.ext.linkcode',
5260
]

doc/source/index.rst.template

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ See the package overview for more detail about what's in the library.
116116
whatsnew
117117
install
118118
contributing
119-
faq
120119
overview
121120
10min
122121
tutorials

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Optional Dependencies
260260
<http://www.vergenet.net/~conrad/software/xsel/>`__, or `xclip
261261
<https://github.com/astrand/xclip/>`__: necessary to use
262262
:func:`~pandas.read_clipboard`. Most package managers on Linux distributions will have ``xclip`` and/or ``xsel`` immediately available for installation.
263-
* For Google BigQuery I/O - see :ref:`here <io.bigquery_deps>`.
263+
* For Google BigQuery I/O - see `here <https://pandas-gbq.readthedocs.io/en/latest/install.html#dependencies>`__
264264

265265
* `Backports.lzma <https://pypi.python.org/pypi/backports.lzma/>`__: Only for Python 2, for writing to and/or reading from an xz compressed DataFrame in CSV; Python 3 support is built into the standard library.
266266
* One of the following combinations of libraries is needed to use the

0 commit comments

Comments
 (0)