Skip to content

Commit 235f969

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into bool_ops3
2 parents c03cc55 + 8382067 commit 235f969

21 files changed

+470
-395
lines changed

doc/source/advanced.rst

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

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

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

+1
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/merging.rst

+7
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ the name of the ``Series``.
323323
labels=['df1', 's1'], vertical=False);
324324
plt.close('all');
325325
326+
.. note::
327+
328+
Since we're concatenating a ``Series`` to a ``DataFrame``, we could have
329+
achieved the same result with :meth:`DataFrame.assign`. To concatenate an
330+
arbitrary number of pandas objects (``DataFrame`` or ``Series``), use
331+
``concat``.
332+
326333
If unnamed ``Series`` are passed they will be numbered consecutively.
327334

328335
.. ipython:: python

doc/source/whatsnew/v0.10.0.txt

+17-9
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

+28-9
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

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

+5-8
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)