Skip to content

Commit 6d14142

Browse files
committed
DOC: improve docstring and add rst doc for #695
1 parent ebb076e commit 6d14142

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

RELEASE.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pandas 0.8.0
3333
on DatetimeIndex (#391)
3434
- Convert DatetimeIndexes to UTC if time zones are different in join/setops
3535
(#864)
36+
- Add limit argument for forward/backward filling to reindex, fillna,
37+
etc. (#825 and others)
3638

3739
**Improvements to existing features**
3840

doc/source/dsintro.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,16 @@ The API for insertion and deletion is the same as for DataFrame. And as with
741741
DataFrame, if the item is a valid python identifier, you can access it as an
742742
attribute and tab-complete it in IPython.
743743

744+
Transposing
745+
~~~~~~~~~~~
746+
747+
A Panel can be rearranged using its ``transpose`` method (which does not make a
748+
copy by default unless the data are heterogeneous):
749+
750+
.. ipython:: python
751+
752+
wp.transpose(2, 0, 1)
753+
744754
Indexing / Selection
745755
~~~~~~~~~~~~~~~~~~~~
746756

pandas/core/panel.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,10 +937,24 @@ def swapaxes(self, axis1='major', axis2='minor', copy=True):
937937
return self._constructor(new_values, *new_axes)
938938

939939
def transpose(self, items='items', major='major', minor='minor',
940-
copy=True):
940+
copy=False):
941941
"""
942942
Permute the dimensions of the Panel
943943
944+
Parameters
945+
----------
946+
items : int or one of {'items', 'major', 'minor'}
947+
major : int or one of {'items', 'major', 'minor'}
948+
minor : int or one of {'items', 'major', 'minor'}
949+
copy : boolean, default False
950+
Make a copy of the underlying data. Mixed-dtype data will
951+
always result in a copy
952+
953+
Examples
954+
--------
955+
>>> p.transpose(2, 0, 1)
956+
>>> p.transpose(2, 0, 1, copy=True)
957+
944958
Returns
945959
-------
946960
y : Panel (new object)

0 commit comments

Comments
 (0)