Skip to content

Commit

Permalink
update panel documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Mar 23, 2020
1 parent 9eec56c commit 259ad41
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions doc/pandas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Working with pandas
===================

One of the most important features of xarray is the ability to convert to and
from :py:mod:`pandas` objects to interact with the rest of the PyData

ecosystem. For example, for plotting labeled data, we highly recommend
using the visualization `built in to pandas itself`__ or provided by the pandas
aware libraries such as `Seaborn`__.
Expand Down Expand Up @@ -112,8 +112,8 @@ automatically stacking them into a ``MultiIndex``.

:py:meth:`DataArray.to_pandas()` is a shortcut that
lets you convert a DataArray directly into a pandas object with the same
dimensionality (i.e., a 1D array is converted to a :py:class:`~pandas.Series`,
2D to :py:class:`~pandas.DataFrame` and 3D to ``pandas.Panel``):
dimensionality (i.e., a 1D array is converted to a :py:class:`~pandas.Series` and
2D to :py:class:`~pandas.DataFrame`):

.. ipython:: python
Expand Down Expand Up @@ -151,11 +151,10 @@ However, you will need to set dimension names explicitly, either with the
Transitioning from pandas.Panel to xarray
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``Panel``, pandas' data structure for 3D arrays, has always
been a second class data structure compared to the Series and DataFrame. To
allow pandas developers to focus more on its core functionality built around
the DataFrame, pandas has deprecated ``Panel``. It will be removed in pandas
0.25.
``Panel``, pandas' data structure for 3D arrays, was always a second class
data structure compared to the Series and DataFrame. To allow pandas
developers to focus more on its core functionality built around the
DataFrame, pandas removed ``Panel``.

xarray has most of ``Panel``'s features, a more explicit API (particularly around
indexing), and the ability to scale to >3 dimensions with the same interface.
Expand Down Expand Up @@ -210,7 +209,7 @@ You can also easily convert this data into ``Dataset``:
array.to_dataset(dim='dim_0')
Here, there are two data variables, each representing a DataFrame on panel's
``items`` axis, and labelled as such. Each variable is a 2D array of the
``items`` axis, and labeled as such. Each variable is a 2D array of the
respective values along the ``items`` dimension.

While the xarray docs are relatively complete, a few items stand out for Panel users:
Expand Down

0 comments on commit 259ad41

Please sign in to comment.