-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: cleanup build warnings #14172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: cleanup build warnings #14172
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -935,134 +935,20 @@ method: | |
minor_axis=['a', 'b', 'c', 'd']) | ||
panel.to_frame() | ||
|
||
|
||
.. _dsintro.panel4d: | ||
|
||
Panel4D (Experimental) | ||
---------------------- | ||
|
||
.. warning:: | ||
|
||
In 0.19.0 ``Panel4D`` is deprecated and will be removed in a future version. The recommended way to represent these types of n-dimensional data are with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas provides a :meth:`~Panel4D.to_xarray` method to automate this conversion. | ||
|
||
``Panel4D`` is a 4-Dimensional named container very much like a ``Panel``, but | ||
having 4 named dimensions. It is intended as a test bed for more N-Dimensional named | ||
containers. | ||
|
||
- **labels**: axis 0, each item corresponds to a Panel contained inside | ||
- **items**: axis 1, each item corresponds to a DataFrame contained inside | ||
- **major_axis**: axis 2, it is the **index** (rows) of each of the | ||
DataFrames | ||
- **minor_axis**: axis 3, it is the **columns** of each of the DataFrames | ||
|
||
``Panel4D`` is a sub-class of ``Panel``, so most methods that work on Panels are | ||
applicable to Panel4D. The following methods are disabled: | ||
|
||
- ``join , to_frame , to_excel , to_sparse , groupby`` | ||
|
||
Construction of Panel4D works in a very similar manner to a ``Panel`` | ||
|
||
From 4D ndarray with optional axis labels | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. ipython:: python | ||
|
||
p4d = pd.Panel4D(np.random.randn(2, 2, 5, 4), | ||
labels=['Label1','Label2'], | ||
items=['Item1', 'Item2'], | ||
major_axis=pd.date_range('1/1/2000', periods=5), | ||
minor_axis=['A', 'B', 'C', 'D']) | ||
p4d | ||
|
||
|
||
From dict of Panel objects | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. ipython:: python | ||
|
||
data = { 'Label1' : pd.Panel({ 'Item1' : pd.DataFrame(np.random.randn(4, 3)) }), | ||
'Label2' : pd.Panel({ 'Item2' : pd.DataFrame(np.random.randn(4, 2)) }) } | ||
pd.Panel4D(data) | ||
|
||
Note that the values in the dict need only be **convertible to Panels**. | ||
Thus, they can be any of the other valid inputs to Panel as per above. | ||
|
||
Slicing | ||
~~~~~~~ | ||
|
||
Slicing works in a similar manner to a Panel. ``[]`` slices the first dimension. | ||
``.ix`` allows you to slice arbitrarily and get back lower dimensional objects | ||
|
||
.. ipython:: python | ||
|
||
p4d['Label1'] | ||
|
||
4D -> Panel | ||
|
||
.. ipython:: python | ||
|
||
p4d.ix[:,:,:,'A'] | ||
|
||
4D -> DataFrame | ||
|
||
.. ipython:: python | ||
|
||
p4d.ix[:,:,0,'A'] | ||
|
||
4D -> Series | ||
|
||
.. ipython:: python | ||
|
||
p4d.ix[:,0,0,'A'] | ||
|
||
Transposing | ||
~~~~~~~~~~~ | ||
|
||
A Panel4D can be rearranged using its ``transpose`` method (which does not make a | ||
copy by default unless the data are heterogeneous): | ||
|
||
.. ipython:: python | ||
|
||
p4d.transpose(3, 2, 1, 0) | ||
|
||
.. _dsintro.panelnd: | ||
.. _dsintro.panel4d: | ||
|
||
PanelND (Experimental) | ||
---------------------- | ||
Panel4D and PanelND (Experimental) | ||
---------------------------------- | ||
|
||
.. warning:: | ||
|
||
In 0.19.0 ``PanelND`` is deprecated and will be removed in a future version. The recommended way to represent these types of n-dimensional data are with the `xarray package <http://xarray.pydata.org/en/stable/>`__. | ||
In 0.19.0 ``Panel4D`` and ``PanelND`` are deprecated and will be removed in | ||
a future version. The recommended way to represent these types of | ||
n-dimensional data are with the | ||
`xarray package <http://xarray.pydata.org/en/stable/>`__. | ||
Pandas provides a :meth:`~Panel4D.to_xarray` method to automate | ||
this conversion. | ||
|
||
PanelND is a module with a set of factory functions to enable a user to construct N-dimensional named | ||
containers like Panel4D, with a custom set of axis labels. Thus a domain-specific container can easily be | ||
created. | ||
|
||
The following creates a Panel5D. A new panel type object must be sliceable into a lower dimensional object. | ||
Here we slice to a Panel4D. | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
|
||
from pandas.core import panelnd | ||
Panel5D = panelnd.create_nd_panel_factory( | ||
klass_name = 'Panel5D', | ||
orders = [ 'cool', 'labels','items','major_axis','minor_axis'], | ||
slices = { 'labels' : 'labels', 'items' : 'items', | ||
'major_axis' : 'major_axis', 'minor_axis' : 'minor_axis' }, | ||
slicer = pd.Panel4D, | ||
aliases = { 'major' : 'major_axis', 'minor' : 'minor_axis' }, | ||
stat_axis = 2) | ||
|
||
p5d = Panel5D(dict(C1 = p4d)) | ||
p5d | ||
|
||
# print a slice of our 5D | ||
p5d.ix['C1',:,:,0:3,:] | ||
|
||
# transpose it | ||
p5d.transpose(1,2,3,4,0) | ||
|
||
# look at the shape & dim | ||
p5d.shape | ||
p5d.ndim | ||
See the `docs of a previous version <http://pandas.pydata.org/pandas-docs/version/0.18.1/dsintro.html#panel4d-experimental>`__ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
for documentation on these objects. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
import pandas as pd | ||
import pandas.util.testing as tm | ||
np.set_printoptions(precision=4, suppress=True) | ||
options.display.max_rows = 15 | ||
pd.options.display.max_rows = 15 | ||
|
||
********************** | ||
Sparse data structures | ||
|
@@ -97,6 +97,7 @@ of SparseArrays. To create one, simply call the ``SparseList`` constructor with | |
a ``fill_value`` (defaulting to ``NaN``): | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
|
||
spl = pd.SparseList() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put a pointer to previous docs as this is now deprecated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
spl | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe Experimental -> Deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes :-)