Skip to content

Commit cec1752

Browse files
committed
DOC: show the Panel.reindex API change in v0.13.0.txt (GH5867)
1 parent 52a82ef commit cec1752

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

doc/source/comparison_with_r.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Base R
3434
~~~~~~~~~~~~
3535

3636
In R you may want to split data into subsets and compute the mean for each.
37-
Using a data.frame called ``df`` and splitting it into groups ``by1`` and
37+
Using a data.frame called ``df`` and splitting it into groups ``by1`` and
3838
``by2``:
3939

4040
.. code-block:: r
@@ -69,13 +69,13 @@ For more details and examples see :ref:`the groupby documentation
6969
|tapply|_
7070
~~~~~~~~~
7171

72-
``tapply`` is similar to ``aggregate``, but data can be in a ragged array,
72+
``tapply`` is similar to ``aggregate``, but data can be in a ragged array,
7373
since the subclass sizes are possibly irregular. Using a data.frame called
7474
``baseball``, and retrieving information based on the array ``team``:
7575

7676
.. code-block:: r
7777
78-
baseball <-
78+
baseball <-
7979
data.frame(team = gl(5, 5,
8080
labels = paste("Team", LETTERS[1:5])),
8181
player = sample(letters, 25),
@@ -122,7 +122,7 @@ index/slice as well as standard boolean indexing:
122122

123123
.. ipython:: python
124124
125-
df = DataFrame({'a': random.randn(10), 'b': random.randn(10)})
125+
df = DataFrame({'a': np.random.randn(10), 'b': np.random.randn(10)})
126126
df.query('a <= b')
127127
df[df.a <= df.b]
128128
df.loc[df.a <= df.b]
@@ -150,7 +150,7 @@ In ``pandas`` the equivalent expression, using the
150150

151151
.. ipython:: python
152152
153-
df = DataFrame({'a': random.randn(10), 'b': random.randn(10)})
153+
df = DataFrame({'a': np.random.randn(10), 'b': np.random.randn(10)})
154154
df.eval('a + b')
155155
df.a + df.b # same as the previous expression
156156
@@ -330,7 +330,7 @@ In Python the best way is to make use of :meth:`~pandas.pivot_table`:
330330
pd.pivot_table(mdf, values='value', rows=['variable','week'],
331331
cols=['month'], aggfunc=np.mean)
332332
333-
Similarly for ``dcast`` which uses a data.frame called ``df`` in R to
333+
Similarly for ``dcast`` which uses a data.frame called ``df`` in R to
334334
aggregate information based on ``Animal`` and ``FeedType``:
335335

336336
.. code-block:: r
@@ -341,10 +341,10 @@ aggregate information based on ``Animal`` and ``FeedType``:
341341
FeedType = c('A', 'B', 'A', 'A', 'B', 'B', 'A'),
342342
Amount = c(10, 7, 4, 2, 5, 6, 2)
343343
)
344-
345-
dcast(df, Animal ~ FeedType, sum, fill=NaN)
344+
345+
dcast(df, Animal ~ FeedType, sum, fill=NaN)
346346
# Alternative method using base R
347-
with(df, tapply(Amount, list(Animal, FeedType), sum))
347+
with(df, tapply(Amount, list(Animal, FeedType), sum))
348348
349349
Python can approach this in two different ways. Firstly, similar to above
350350
using :meth:`~pandas.pivot_table`:
@@ -365,7 +365,7 @@ The second approach is to use the :meth:`~pandas.DataFrame.groupby` method:
365365
.. ipython:: python
366366
367367
df.groupby(['Animal','FeedType'])['Amount'].sum()
368-
368+
369369
For more details and examples see :ref:`the reshaping documentation
370370
<reshaping.pivot>` or :ref:`the groupby documentation<groupby.split>`.
371371

doc/source/v0.13.0.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ API changes
167167
dfc.loc[0,'A'] = 11
168168
dfc
169169

170+
- ``Panel.reindex`` has the following call signature ``Panel.reindex(items=None, major_axis=None, minor_axis=None, **kwargs)``
171+
to conform with other ``NDFrame`` objects. See :ref:`Internal Refactoring<whatsnew_0130.refactoring>` for more information.
172+
170173
Prior Version Deprecations/Changes
171174
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172175

0 commit comments

Comments
 (0)