Skip to content

Commit cde4cee

Browse files
DOC: Remove makePanel from docs (pandas-dev#25609)
1 parent 5c159d2 commit cde4cee

File tree

4 files changed

+0
-159
lines changed

4 files changed

+0
-159
lines changed

doc/source/getting_started/dsintro.rst

-44
Original file line numberDiff line numberDiff line change
@@ -1030,47 +1030,3 @@ method:
10301030
major_axis=pd.date_range('1/1/2000', periods=5),
10311031
minor_axis=['a', 'b', 'c', 'd'])
10321032
panel.to_frame()
1033-
1034-
1035-
.. _dsintro.deprecate_panel:
1036-
1037-
Deprecate Panel
1038-
---------------
1039-
1040-
Over the last few years, pandas has increased in both breadth and depth, with new features,
1041-
datatype support, and manipulation routines. As a result, supporting efficient indexing and functional
1042-
routines for ``Series``, ``DataFrame`` and ``Panel`` has contributed to an increasingly fragmented and
1043-
difficult-to-understand code base.
1044-
1045-
The 3-D structure of a ``Panel`` is much less common for many types of data analysis,
1046-
than the 1-D of the ``Series`` or the 2-D of the ``DataFrame``. Going forward it makes sense for
1047-
pandas to focus on these areas exclusively.
1048-
1049-
Oftentimes, one can simply use a MultiIndex ``DataFrame`` for easily working with higher dimensional data.
1050-
1051-
In addition, the ``xarray`` package was built from the ground up, specifically in order to
1052-
support the multi-dimensional analysis that is one of ``Panel`` s main use cases.
1053-
`Here is a link to the xarray panel-transition documentation <https://xarray.pydata.org/en/stable/pandas.html#panel-transition>`__.
1054-
1055-
.. ipython:: python
1056-
:okwarning:
1057-
1058-
import pandas.util.testing as tm
1059-
p = tm.makePanel()
1060-
p
1061-
1062-
Convert to a MultiIndex DataFrame.
1063-
1064-
.. ipython:: python
1065-
:okwarning:
1066-
1067-
p.to_frame()
1068-
1069-
Alternatively, one can convert to an xarray ``DataArray``.
1070-
1071-
.. ipython:: python
1072-
:okwarning:
1073-
1074-
p.to_xarray()
1075-
1076-
You can see the full-documentation for the `xarray package <https://xarray.pydata.org/en/stable/>`__.

doc/source/whatsnew/v0.13.1.rst

-54
Original file line numberDiff line numberDiff line change
@@ -222,60 +222,6 @@ Enhancements
222222
223223
- Panel :meth:`~pandas.Panel.apply` will work on non-ufuncs. See :ref:`the docs<basics.apply>`.
224224

225-
.. ipython:: python
226-
227-
import pandas.util.testing as tm
228-
panel = tm.makePanel(5)
229-
panel
230-
panel['ItemA']
231-
232-
Specifying an ``apply`` that operates on a Series (to return a single element)
233-
234-
.. ipython:: python
235-
236-
panel.apply(lambda x: x.dtype, axis='items')
237-
238-
A similar reduction type operation
239-
240-
.. ipython:: python
241-
242-
panel.apply(lambda x: x.sum(), axis='major_axis')
243-
244-
This is equivalent to
245-
246-
.. ipython:: python
247-
248-
panel.sum('major_axis')
249-
250-
A transformation operation that returns a Panel, but is computing
251-
the z-score across the major_axis
252-
253-
.. ipython:: python
254-
255-
result = panel.apply(lambda x: (x - x.mean()) / x.std(),
256-
axis='major_axis')
257-
result
258-
result['ItemA']
259-
260-
- Panel :meth:`~pandas.Panel.apply` operating on cross-sectional slabs. (:issue:`1148`)
261-
262-
.. ipython:: python
263-
264-
def f(x):
265-
return ((x.T - x.mean(1)) / x.std(1)).T
266-
267-
result = panel.apply(f, axis=['items', 'major_axis'])
268-
result
269-
result.loc[:, :, 'ItemA']
270-
271-
This is equivalent to the following
272-
273-
.. ipython:: python
274-
275-
result = pd.Panel({ax: f(panel.loc[:, :, ax]) for ax in panel.minor_axis})
276-
277-
result
278-
result.loc[:, :, 'ItemA']
279225

280226
Performance
281227
~~~~~~~~~~~

doc/source/whatsnew/v0.20.0.rst

-28
Original file line numberDiff line numberDiff line change
@@ -1354,34 +1354,6 @@ Using ``.iloc``. Here we will get the location of the 'A' column, then use *posi
13541354
df.iloc[[0, 2], df.columns.get_loc('A')]
13551355
13561356
1357-
.. _whatsnew_0200.api_breaking.deprecate_panel:
1358-
1359-
Deprecate Panel
1360-
^^^^^^^^^^^^^^^
1361-
1362-
``Panel`` is deprecated and will be removed in a future version. The recommended way to represent 3-D data are
1363-
with a ``MultiIndex`` on a ``DataFrame`` via the :meth:`~Panel.to_frame` or with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas
1364-
provides a :meth:`~Panel.to_xarray` method to automate this conversion. For more details see :ref:`Deprecate Panel <dsintro.deprecate_panel>` documentation. (:issue:`13563`).
1365-
1366-
.. ipython:: python
1367-
:okwarning:
1368-
1369-
p = tm.makePanel()
1370-
p
1371-
1372-
Convert to a MultiIndex DataFrame
1373-
1374-
.. ipython:: python
1375-
1376-
p.to_frame()
1377-
1378-
Convert to an xarray DataArray
1379-
1380-
.. ipython:: python
1381-
:okwarning:
1382-
1383-
p.to_xarray()
1384-
13851357
.. _whatsnew_0200.api_breaking.deprecate_group_agg_dict:
13861358

13871359
Deprecate groupby.agg() with a dictionary when renaming

doc/source/whatsnew/v0.23.0.rst

-33
Original file line numberDiff line numberDiff line change
@@ -637,39 +637,6 @@ If you wish to retain the old behavior while using Python >= 3.6, you can use
637637
'Taxes': -200,
638638
'Net result': 300}).sort_index()
639639
640-
.. _whatsnew_0230.api_breaking.deprecate_panel:
641-
642-
Deprecate Panel
643-
^^^^^^^^^^^^^^^
644-
645-
``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
646-
with a ``MultiIndex`` on a ``DataFrame`` via the :meth:`~Panel.to_frame` or with the `xarray package <http://xarray.pydata.org/en/stable/>`__. Pandas
647-
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`).
648-
649-
.. ipython:: python
650-
:suppress:
651-
652-
import pandas.util.testing as tm
653-
654-
.. ipython:: python
655-
:okwarning:
656-
657-
p = tm.makePanel()
658-
p
659-
660-
Convert to a MultiIndex DataFrame
661-
662-
.. ipython:: python
663-
664-
p.to_frame()
665-
666-
Convert to an xarray DataArray
667-
668-
.. ipython:: python
669-
:okwarning:
670-
671-
p.to_xarray()
672-
673640
674641
.. _whatsnew_0230.api_breaking.core_common:
675642

0 commit comments

Comments
 (0)