Skip to content

Commit 1b10ca2

Browse files
authored
Merge branch 'master' into dep_keyword
2 parents 4c83659 + 740ad9a commit 1b10ca2

Some content is hidden

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

45 files changed

+1653
-1010
lines changed

.travis.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ matrix:
5050
packages:
5151
- python-gtk2
5252
# In allow_failures
53-
- dist: trusty
54-
env:
55-
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network"
5653
- dist: trusty
5754
env:
5855
- JOB="3.6" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" CONDA_FORGE=true COVERAGE=true
@@ -63,36 +60,26 @@ matrix:
6360
# In allow_failures
6461
- dist: trusty
6562
env:
66-
- JOB="3.6_PIP_BUILD_TEST" TEST_ARGS="--skip-slow" PIP_BUILD_TEST=true
63+
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
6764
addons:
6865
apt:
6966
packages:
7067
- xsel
7168
# In allow_failures
72-
- dist: trusty
73-
env:
74-
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
75-
# In allow_failures
7669
- dist: trusty
7770
env:
7871
- JOB="3.6_DOC" DOC=true
7972
allow_failures:
80-
- dist: trusty
81-
env:
82-
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network"
8373
- dist: trusty
8474
env:
8575
- JOB="2.7_SLOW" SLOW=true
8676
- dist: trusty
8777
env:
88-
- JOB="3.6_PIP_BUILD_TEST" TEST_ARGS="--skip-slow" PIP_BUILD_TEST=true
78+
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
8979
addons:
9080
apt:
9181
packages:
9282
- xsel
93-
- dist: trusty
94-
env:
95-
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
9683
- dist: trusty
9784
env:
9885
- JOB="3.6_DOC" DOC=true

ci/install_travis.sh

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ if [ "$COVERAGE" ]; then
115115
pip install coverage pytest-cov
116116
fi
117117

118-
echo
119-
if [ -z "$PIP_BUILD_TEST" ] ; then
120-
121-
# build but don't install
122-
echo "[build em]"
123-
time python setup.py build_ext --inplace || exit 1
124-
125-
fi
126-
127118
# we may have run installations
128119
echo
129120
echo "[conda installs]"
@@ -161,23 +152,8 @@ conda list pandas
161152
pip list --format columns |grep pandas
162153

163154
# build and install
164-
echo
165-
166-
if [ "$PIP_BUILD_TEST" ]; then
167-
168-
# build & install testing
169-
echo "[building release]"
170-
time bash scripts/build_dist_for_release.sh || exit 1
171-
conda uninstall -y cython
172-
time pip install dist/*tar.gz || exit 1
173-
174-
else
175-
176-
# install our pandas
177-
echo "[running setup.py develop]"
178-
python setup.py develop || exit 1
179-
180-
fi
155+
echo "[running setup.py develop]"
156+
python setup.py develop || exit 1
181157

182158
echo
183159
echo "[show pandas]"

ci/requirements-3.6_PIP_BUILD_TEST.build

Lines changed: 0 additions & 6 deletions
This file was deleted.

ci/requirements-3.6_PIP_BUILD_TEST.pip

Lines changed: 0 additions & 6 deletions
This file was deleted.

ci/requirements-3.6_PIP_BUILD_TEST.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

ci/requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pytest>=3.1
77
python-dateutil>=2.5.0
88
pytz
99
setuptools>=3.3
10-
sphinx
10+
sphinx=1.5*

ci/script_multi.sh

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

15+
# Enforce absent network during testing by faking a proxy
16+
if echo "$TEST_ARGS" | grep -e --skip-network -q; then
17+
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
18+
fi
19+
1520
# Workaround for pytest-xdist flaky collection order
1621
# https://github.com/pytest-dev/pytest/issues/920
1722
# https://github.com/pytest-dev/pytest/issues/1075
1823
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
1924
echo PYTHONHASHSEED=$PYTHONHASHSEED
2025

21-
if [ "$PIP_BUILD_TEST" ] ; then
22-
echo "[build-test]"
23-
24-
echo "[env]"
25-
pip list --format columns |grep pandas
26-
27-
echo "[running]"
28-
cd /tmp
29-
unset PYTHONPATH
30-
31-
echo "[build-test: single]"
32-
python -c 'import pandas; pandas.test(["--skip-slow", "--skip-network", "-r xX", "-m single"])'
33-
34-
echo "[build-test: not single]"
35-
python -c 'import pandas; pandas.test(["-n 2", "--skip-slow", "--skip-network", "-r xX", "-m not single"])'
36-
37-
elif [ "$DOC" ]; then
26+
if [ "$DOC" ]; then
3827
echo "We are not running pytest as this is a doc-build"
3928

4029
elif [ "$COVERAGE" ]; then

ci/script_single.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ if [ "$SLOW" ]; then
1616
TEST_ARGS="--only-slow --skip-network"
1717
fi
1818

19-
if [ "$PIP_BUILD_TEST" ]; then
20-
echo "We are not running pytest as this is a build test."
19+
# Enforce absent network during testing by faking a proxy
20+
if echo "$TEST_ARGS" | grep -e --skip-network -q; then
21+
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
22+
fi
2123

22-
elif [ "$DOC" ]; then
24+
if [ "$DOC" ]; then
2325
echo "We are not running pytest as this is a doc-build"
2426

2527
elif [ "$COVERAGE" ]; then

doc/source/advanced.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Passing a list of labels or tuples works similar to reindexing:
274274
275275
df.loc[[('bar', 'two'), ('qux', 'one')]]
276276
277-
.. info::
277+
.. note::
278278

279279
It is important to note that tuples and lists are not treated identically
280280
in pandas when it comes to indexing. Whereas a tuple is interpreted as one

doc/source/api.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,16 @@ MultiIndex Components
16821682
MultiIndex.reorder_levels
16831683
MultiIndex.remove_unused_levels
16841684

1685+
MultiIndex Selecting
1686+
~~~~~~~~~~~~~~~~~~~~
1687+
1688+
.. autosummary::
1689+
:toctree: generated/
1690+
1691+
MultiIndex.get_loc
1692+
MultiIndex.get_indexer
1693+
MultiIndex.get_level_values
1694+
16851695
.. _api.datetimeindex:
16861696

16871697
DatetimeIndex

doc/source/dsintro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ to be inserted (for example, a ``Series`` or NumPy array), or a function
506506
of one argument to be called on the ``DataFrame``. A *copy* of the original
507507
DataFrame is returned, with the new values inserted.
508508

509-
.. versionmodified:: 0.23.0
509+
.. versionchanged:: 0.23.0
510510

511511
Starting with Python 3.6 the order of ``**kwargs`` is preserved. This allows
512512
for *dependent* assignment, where an expression later in ``**kwargs`` can refer

doc/source/io.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,7 @@ is not round-trippable, nor are any names beginning with 'level_' within a
22622262
indicate missing values and the subsequent read cannot distinguish the intent.
22632263

22642264
.. ipython:: python
2265+
:okwarning:
22652266
22662267
df.index.name = 'index'
22672268
df.to_json('test.json', orient='table')

doc/source/timedeltas.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,20 @@ Rounded division (floor-division) of a ``timedelta64[ns]`` Series by a scalar
283283
td // pd.Timedelta(days=3, hours=4)
284284
pd.Timedelta(days=3, hours=4) // td
285285
286+
.. _timedeltas.mod_divmod:
287+
288+
The mod (%) and divmod operations are defined for ``Timedelta`` when operating with another timedelta-like or with a numeric argument.
289+
290+
.. ipython:: python
291+
292+
pd.Timedelta(hours=37) % datetime.timedelta(hours=2)
293+
294+
# divmod against a timedelta-like returns a pair (int, Timedelta)
295+
divmod(datetime.timedelta(hours=2), pd.Timedelta(minutes=11))
296+
297+
# divmod against a numeric returns a pair (Timedelta, Timedelta)
298+
divmod(pd.Timedelta(hours=25), 86400000000000)
299+
286300
Attributes
287301
----------
288302

doc/source/whatsnew/v0.10.0.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,23 @@ N Dimensional Panels (Experimental)
411411
Adding experimental support for Panel4D and factory functions to create n-dimensional named panels.
412412
:ref:`Docs <dsintro.panel4d>` for NDim. Here is a taste of what to expect.
413413

414-
.. ipython:: python
415-
:okwarning:
416-
417-
p4d = Panel4D(randn(2, 2, 5, 4),
418-
labels=['Label1','Label2'],
419-
items=['Item1', 'Item2'],
420-
major_axis=date_range('1/1/2000', periods=5),
421-
minor_axis=['A', 'B', 'C', 'D'])
422-
p4d
414+
.. code-block:: ipython
415+
416+
In [58]: p4d = Panel4D(randn(2, 2, 5, 4),
417+
....: labels=['Label1','Label2'],
418+
....: items=['Item1', 'Item2'],
419+
....: major_axis=date_range('1/1/2000', periods=5),
420+
....: minor_axis=['A', 'B', 'C', 'D'])
421+
....:
422+
423+
In [59]: p4d
424+
Out[59]:
425+
<class 'pandas.core.panelnd.Panel4D'>
426+
Dimensions: 2 (labels) x 2 (items) x 5 (major_axis) x 4 (minor_axis)
427+
Labels axis: Label1 to Label2
428+
Items axis: Item1 to Item2
429+
Major_axis axis: 2000-01-01 00:00:00 to 2000-01-05 00:00:00
430+
Minor_axis axis: A to D
423431

424432

425433

doc/source/whatsnew/v0.13.1.txt

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,44 @@ API changes
140140
applied would be called with an empty ``Series`` to guess whether a
141141
``Series`` or ``DataFrame`` should be returned:
142142

143-
.. ipython:: python
143+
.. code-block:: ipython
144+
145+
In [32]: def applied_func(col):
146+
....: print("Apply function being called with: ", col)
147+
....: return col.sum()
148+
....:
144149

145-
def applied_func(col):
146-
print("Apply function being called with: ", col)
147-
return col.sum()
150+
In [33]: empty = DataFrame(columns=['a', 'b'])
148151

149-
empty = DataFrame(columns=['a', 'b'])
150-
empty.apply(applied_func)
152+
In [34]: empty.apply(applied_func)
153+
Apply function being called with: Series([], Length: 0, dtype: float64)
154+
Out[34]:
155+
a NaN
156+
b NaN
157+
Length: 2, dtype: float64
151158

152159
Now, when ``apply`` is called on an empty ``DataFrame``: if the ``reduce``
153160
argument is ``True`` a ``Series`` will returned, if it is ``False`` a
154161
``DataFrame`` will be returned, and if it is ``None`` (the default) the
155162
function being applied will be called with an empty series to try and guess
156163
the return type.
157164

158-
.. ipython:: python
165+
.. code-block:: ipython
166+
167+
In [35]: empty.apply(applied_func, reduce=True)
168+
Out[35]:
169+
a NaN
170+
b NaN
171+
Length: 2, dtype: float64
172+
173+
In [36]: empty.apply(applied_func, reduce=False)
174+
Out[36]:
175+
Empty DataFrame
176+
Columns: [a, b]
177+
Index: []
178+
179+
[0 rows x 2 columns]
159180

160-
empty.apply(applied_func, reduce=True)
161-
empty.apply(applied_func, reduce=False)
162181

163182
Prior Version Deprecations/Changes
164183
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/whatsnew/v0.15.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ Other:
10441044

10451045
idx = MultiIndex.from_product([['a'], range(3), list("pqr")], names=['foo', 'bar', 'baz'])
10461046
idx.set_names('qux', level=0)
1047-
idx.set_names(['qux','baz'], level=[0,1])
1047+
idx.set_names(['qux','corge'], level=[0,1])
10481048
idx.set_levels(['a','b','c'], level='bar')
10491049
idx.set_levels([['a','b','c'],[1,2,3]], level=[1,2])
10501050

doc/source/whatsnew/v0.21.0.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -894,17 +894,14 @@ imported. Matplotlib plot methods (``plt.plot``, ``ax.plot``, ...), will not
894894
nicely format the x-axis for ``DatetimeIndex`` or ``PeriodIndex`` values. You
895895
must explicitly register these methods:
896896

897-
.. ipython:: python
898-
899-
from pandas.tseries import converter
900-
converter.register()
901-
902-
fig, ax = plt.subplots()
903-
plt.plot(pd.date_range('2017', periods=6), range(6))
904-
905897
Pandas built-in ``Series.plot`` and ``DataFrame.plot`` *will* register these
906898
converters on first-use (:issue:17710).
907899

900+
.. note::
901+
902+
This change has been temporarily reverted in pandas 0.21.1,
903+
for more details see :ref:`here <whatsnew_0211.converters>`.
904+
908905
.. _whatsnew_0210.api:
909906

910907
Other API Changes

0 commit comments

Comments
 (0)