Skip to content

DOC: Remove makePanel from docs (#25609) #25612

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

Merged
merged 5 commits into from
Mar 10, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions doc/source/getting_started/dsintro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1030,47 +1030,3 @@ method:
major_axis=pd.date_range('1/1/2000', periods=5),
minor_axis=['a', 'b', 'c', 'd'])
panel.to_frame()


.. _dsintro.deprecate_panel:

Deprecate Panel
---------------

Over the last few years, pandas has increased in both breadth and depth, with new features,
datatype support, and manipulation routines. As a result, supporting efficient indexing and functional
routines for ``Series``, ``DataFrame`` and ``Panel`` has contributed to an increasingly fragmented and
difficult-to-understand code base.

The 3-D structure of a ``Panel`` is much less common for many types of data analysis,
than the 1-D of the ``Series`` or the 2-D of the ``DataFrame``. Going forward it makes sense for
pandas to focus on these areas exclusively.

Oftentimes, one can simply use a MultiIndex ``DataFrame`` for easily working with higher dimensional data.

In addition, the ``xarray`` package was built from the ground up, specifically in order to
support the multi-dimensional analysis that is one of ``Panel`` s main use cases.
`Here is a link to the xarray panel-transition documentation <https://xarray.pydata.org/en/stable/pandas.html#panel-transition>`__.

.. ipython:: python
:okwarning:

import pandas.util.testing as tm
p = tm.makePanel()
p

Convert to a MultiIndex DataFrame.

.. ipython:: python
:okwarning:

p.to_frame()

Alternatively, one can convert to an xarray ``DataArray``.

.. ipython:: python
:okwarning:

p.to_xarray()

You can see the full-documentation for the `xarray package <https://xarray.pydata.org/en/stable/>`__.
54 changes: 0 additions & 54 deletions doc/source/whatsnew/v0.13.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,60 +222,6 @@ Enhancements

- Panel :meth:`~pandas.Panel.apply` will work on non-ufuncs. See :ref:`the docs<basics.apply>`.

.. ipython:: python

import pandas.util.testing as tm
panel = tm.makePanel(5)
panel
panel['ItemA']

Specifying an ``apply`` that operates on a Series (to return a single element)

.. ipython:: python

panel.apply(lambda x: x.dtype, axis='items')

A similar reduction type operation

.. ipython:: python

panel.apply(lambda x: x.sum(), axis='major_axis')

This is equivalent to

.. ipython:: python

panel.sum('major_axis')

A transformation operation that returns a Panel, but is computing
the z-score across the major_axis

.. ipython:: python

result = panel.apply(lambda x: (x - x.mean()) / x.std(),
axis='major_axis')
result
result['ItemA']

- Panel :meth:`~pandas.Panel.apply` operating on cross-sectional slabs. (:issue:`1148`)

.. ipython:: python

def f(x):
return ((x.T - x.mean(1)) / x.std(1)).T

result = panel.apply(f, axis=['items', 'major_axis'])
result
result.loc[:, :, 'ItemA']

This is equivalent to the following

.. ipython:: python

result = pd.Panel({ax: f(panel.loc[:, :, ax]) for ax in panel.minor_axis})

result
result.loc[:, :, 'ItemA']

Performance
~~~~~~~~~~~
Expand Down
33 changes: 0 additions & 33 deletions doc/source/whatsnew/v0.20.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ Check the :ref:`API Changes <whatsnew_0200.api_breaking>` and :ref:`deprecations
New features
~~~~~~~~~~~~

.. ipython:: python
:suppress:

import pandas.util.testing as tm

.. _whatsnew_0200.enhancements.agg:

``agg`` API for DataFrame/Series
Expand Down Expand Up @@ -1354,34 +1349,6 @@ Using ``.iloc``. Here we will get the location of the 'A' column, then use *posi
df.iloc[[0, 2], df.columns.get_loc('A')]


.. _whatsnew_0200.api_breaking.deprecate_panel:

Deprecate Panel
^^^^^^^^^^^^^^^

``Panel`` is deprecated and will be removed in a future version. The recommended way to represent 3-D data are
with a ``MultiIndex`` on a ``DataFrame`` via the :meth:`~Panel.to_frame` or with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas
provides a :meth:`~Panel.to_xarray` method to automate this conversion. For more details see :ref:`Deprecate Panel <dsintro.deprecate_panel>` documentation. (:issue:`13563`).

.. ipython:: python
:okwarning:

p = tm.makePanel()
p

Convert to a MultiIndex DataFrame

.. ipython:: python

p.to_frame()

Convert to an xarray DataArray

.. ipython:: python
:okwarning:

p.to_xarray()

.. _whatsnew_0200.api_breaking.deprecate_group_agg_dict:

Deprecate groupby.agg() with a dictionary when renaming
Expand Down
33 changes: 0 additions & 33 deletions doc/source/whatsnew/v0.23.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -637,39 +637,6 @@ If you wish to retain the old behavior while using Python >= 3.6, you can use
'Taxes': -200,
'Net result': 300}).sort_index()

.. _whatsnew_0230.api_breaking.deprecate_panel:

Deprecate Panel
^^^^^^^^^^^^^^^

``Panel`` was deprecated in the 0.20.x release, showing as a ``DeprecationWarning``. Using ``Panel`` will now show a ``FutureWarning``. The recommended way to represent 3-D data are
with a ``MultiIndex`` on a ``DataFrame`` via the :meth:`~Panel.to_frame` or with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas
provides a :meth:`~Panel.to_xarray` method to automate this conversion. For more details see :ref:`Deprecate Panel <dsintro.deprecate_panel>` documentation. (:issue:`13563`, :issue:`18324`).

.. ipython:: python
:suppress:

import pandas.util.testing as tm

.. ipython:: python
:okwarning:

p = tm.makePanel()
p

Convert to a MultiIndex DataFrame

.. ipython:: python

p.to_frame()

Convert to an xarray DataArray

.. ipython:: python
:okwarning:

p.to_xarray()


.. _whatsnew_0230.api_breaking.core_common:

Expand Down