Skip to content

Commit 1ace12b

Browse files
DOC: cleanup build warnings (#14172)
* DOC: remove examples on Panel4D (caused warnings) and refer to older docs * DOC: fix build warnings * resolve comments
1 parent 9b7efd6 commit 1ace12b

File tree

9 files changed

+44
-181
lines changed

9 files changed

+44
-181
lines changed

doc/source/dsintro.rst

+11-125
Original file line numberDiff line numberDiff line change
@@ -935,134 +935,20 @@ method:
935935
minor_axis=['a', 'b', 'c', 'd'])
936936
panel.to_frame()
937937
938-
939-
.. _dsintro.panel4d:
940-
941-
Panel4D (Experimental)
942-
----------------------
943-
944-
.. warning::
945-
946-
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.
947-
948-
``Panel4D`` is a 4-Dimensional named container very much like a ``Panel``, but
949-
having 4 named dimensions. It is intended as a test bed for more N-Dimensional named
950-
containers.
951-
952-
- **labels**: axis 0, each item corresponds to a Panel contained inside
953-
- **items**: axis 1, each item corresponds to a DataFrame contained inside
954-
- **major_axis**: axis 2, it is the **index** (rows) of each of the
955-
DataFrames
956-
- **minor_axis**: axis 3, it is the **columns** of each of the DataFrames
957-
958-
``Panel4D`` is a sub-class of ``Panel``, so most methods that work on Panels are
959-
applicable to Panel4D. The following methods are disabled:
960-
961-
- ``join , to_frame , to_excel , to_sparse , groupby``
962-
963-
Construction of Panel4D works in a very similar manner to a ``Panel``
964-
965-
From 4D ndarray with optional axis labels
966-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
967-
968-
.. ipython:: python
969-
970-
p4d = pd.Panel4D(np.random.randn(2, 2, 5, 4),
971-
labels=['Label1','Label2'],
972-
items=['Item1', 'Item2'],
973-
major_axis=pd.date_range('1/1/2000', periods=5),
974-
minor_axis=['A', 'B', 'C', 'D'])
975-
p4d
976-
977-
978-
From dict of Panel objects
979-
~~~~~~~~~~~~~~~~~~~~~~~~~~
980-
981-
.. ipython:: python
982-
983-
data = { 'Label1' : pd.Panel({ 'Item1' : pd.DataFrame(np.random.randn(4, 3)) }),
984-
'Label2' : pd.Panel({ 'Item2' : pd.DataFrame(np.random.randn(4, 2)) }) }
985-
pd.Panel4D(data)
986-
987-
Note that the values in the dict need only be **convertible to Panels**.
988-
Thus, they can be any of the other valid inputs to Panel as per above.
989-
990-
Slicing
991-
~~~~~~~
992-
993-
Slicing works in a similar manner to a Panel. ``[]`` slices the first dimension.
994-
``.ix`` allows you to slice arbitrarily and get back lower dimensional objects
995-
996-
.. ipython:: python
997-
998-
p4d['Label1']
999-
1000-
4D -> Panel
1001-
1002-
.. ipython:: python
1003-
1004-
p4d.ix[:,:,:,'A']
1005-
1006-
4D -> DataFrame
1007-
1008-
.. ipython:: python
1009-
1010-
p4d.ix[:,:,0,'A']
1011-
1012-
4D -> Series
1013-
1014-
.. ipython:: python
1015-
1016-
p4d.ix[:,0,0,'A']
1017-
1018-
Transposing
1019-
~~~~~~~~~~~
1020-
1021-
A Panel4D can be rearranged using its ``transpose`` method (which does not make a
1022-
copy by default unless the data are heterogeneous):
1023-
1024-
.. ipython:: python
1025-
1026-
p4d.transpose(3, 2, 1, 0)
1027-
1028938
.. _dsintro.panelnd:
939+
.. _dsintro.panel4d:
1029940

1030-
PanelND (Experimental)
1031-
----------------------
941+
Panel4D and PanelND (Deprecated)
942+
--------------------------------
1032943

1033944
.. warning::
1034945

1035-
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/>`__.
946+
In 0.19.0 ``Panel4D`` and ``PanelND`` are deprecated and will be removed in
947+
a future version. The recommended way to represent these types of
948+
n-dimensional data are with the
949+
`xarray package <http://xarray.pydata.org/en/stable/>`__.
950+
Pandas provides a :meth:`~Panel4D.to_xarray` method to automate
951+
this conversion.
1036952

1037-
PanelND is a module with a set of factory functions to enable a user to construct N-dimensional named
1038-
containers like Panel4D, with a custom set of axis labels. Thus a domain-specific container can easily be
1039-
created.
1040-
1041-
The following creates a Panel5D. A new panel type object must be sliceable into a lower dimensional object.
1042-
Here we slice to a Panel4D.
1043-
1044-
.. ipython:: python
1045-
:okwarning:
1046-
1047-
from pandas.core import panelnd
1048-
Panel5D = panelnd.create_nd_panel_factory(
1049-
klass_name = 'Panel5D',
1050-
orders = [ 'cool', 'labels','items','major_axis','minor_axis'],
1051-
slices = { 'labels' : 'labels', 'items' : 'items',
1052-
'major_axis' : 'major_axis', 'minor_axis' : 'minor_axis' },
1053-
slicer = pd.Panel4D,
1054-
aliases = { 'major' : 'major_axis', 'minor' : 'minor_axis' },
1055-
stat_axis = 2)
1056-
1057-
p5d = Panel5D(dict(C1 = p4d))
1058-
p5d
1059-
1060-
# print a slice of our 5D
1061-
p5d.ix['C1',:,:,0:3,:]
1062-
1063-
# transpose it
1064-
p5d.transpose(1,2,3,4,0)
1065-
1066-
# look at the shape & dim
1067-
p5d.shape
1068-
p5d.ndim
953+
See the `docs of a previous version <http://pandas.pydata.org/pandas-docs/version/0.18.1/dsintro.html#panel4d-experimental>`__
954+
for documentation on these objects.

doc/source/install.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ Optional Dependencies
255255

256256
* `matplotlib <http://matplotlib.org/>`__: for plotting
257257
* For Excel I/O:
258+
258259
* `xlrd/xlwt <http://www.python-excel.org/>`__: Excel reading (xlrd) and writing (xlwt)
259260
* `openpyxl <http://packages.python.org/openpyxl/>`__: openpyxl version 1.6.1
260261
or higher (but lower than 2.0.0), or version 2.2 or higher, for writing .xlsx files (xlrd >= 0.9.0)
@@ -296,8 +297,8 @@ Optional Dependencies
296297
<html-gotchas>`. It explains issues surrounding the installation and
297298
usage of the above three libraries
298299
* You may need to install an older version of `BeautifulSoup4`_:
299-
- Versions 4.2.1, 4.1.3 and 4.0.2 have been confirmed for 64 and
300-
32-bit Ubuntu/Debian
300+
Versions 4.2.1, 4.1.3 and 4.0.2 have been confirmed for 64 and 32-bit
301+
Ubuntu/Debian
301302
* Additionally, if you're using `Anaconda`_ you should definitely
302303
read :ref:`the gotchas about HTML parsing libraries <html-gotchas>`
303304

doc/source/sparse.rst

+4-32
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pandas as pd
1010
import pandas.util.testing as tm
1111
np.set_printoptions(precision=4, suppress=True)
12-
options.display.max_rows = 15
12+
pd.options.display.max_rows = 15
1313
1414
**********************
1515
Sparse data structures
@@ -90,38 +90,10 @@ can be converted back to a regular ndarray by calling ``to_dense``:
9090
SparseList
9191
----------
9292

93-
.. note:: The ``SparseList`` class has been deprecated and will be removed in a future version.
93+
The ``SparseList`` class has been deprecated and will be removed in a future version.
94+
See the `docs of a previous version <http://pandas.pydata.org/pandas-docs/version/0.18.1/sparse.html#sparselist>`__
95+
for documentation on ``SparseList``.
9496

95-
``SparseList`` is a list-like data structure for managing a dynamic collection
96-
of SparseArrays. To create one, simply call the ``SparseList`` constructor with
97-
a ``fill_value`` (defaulting to ``NaN``):
98-
99-
.. ipython:: python
100-
101-
spl = pd.SparseList()
102-
spl
103-
104-
The two important methods are ``append`` and ``to_array``. ``append`` can
105-
accept scalar values or any 1-dimensional sequence:
106-
107-
.. ipython:: python
108-
:suppress:
109-
110-
.. ipython:: python
111-
112-
spl.append(np.array([1., np.nan, np.nan, 2., 3.]))
113-
spl.append(5)
114-
spl.append(sparr)
115-
spl
116-
117-
As you can see, all of the contents are stored internally as a list of
118-
memory-efficient ``SparseArray`` objects. Once you've accumulated all of the
119-
data, you can call ``to_array`` to get a single ``SparseArray`` with all the
120-
data:
121-
122-
.. ipython:: python
123-
124-
spl.to_array()
12597

12698
SparseIndex objects
12799
-------------------

doc/source/timeseries.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ objects.
12191219
ts.shift(1)
12201220
12211221
The shift method accepts an ``freq`` argument which can accept a
1222-
``DateOffset`` class or other ``timedelta``-like object or also a :ref:`offset alias <timeseries.alias>`:
1222+
``DateOffset`` class or other ``timedelta``-like object or also a :ref:`offset alias <timeseries.offset_aliases>`:
12231223

12241224
.. ipython:: python
12251225
@@ -1494,7 +1494,7 @@ level of ``MultiIndex``, its name or location can be passed to the
14941494

14951495
.. ipython:: python
14961496
1497-
df.resample(level='d').sum()
1497+
df.resample('M', level='d').sum()
14981498
14991499
15001500
.. _timeseries.periods:
@@ -1630,8 +1630,6 @@ Period Dtypes
16301630
``PeriodIndex`` has a custom ``period`` dtype. This is a pandas extension
16311631
dtype similar to the :ref:`timezone aware dtype <timeseries.timezone_series>` (``datetime64[ns, tz]``).
16321632

1633-
.. _timeseries.timezone_series:
1634-
16351633
The ``period`` dtype holds the ``freq`` attribute and is represented with
16361634
``period[freq]`` like ``period[D]`` or ``period[M]``, using :ref:`frequency strings <timeseries.offset_aliases>`.
16371635

doc/source/whatsnew/v0.14.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Experimental
156156
~~~~~~~~~~~~
157157

158158
- ``pandas.io.data.Options`` has a new method, ``get_all_data`` method, and now consistently returns a
159-
multi-indexed ``DataFrame``, see :ref:`the docs <remote_data.yahoo_options>`. (:issue:`5602`)
159+
multi-indexed ``DataFrame`` (:issue:`5602`)
160160
- ``io.gbq.read_gbq`` and ``io.gbq.to_gbq`` were refactored to remove the
161161
dependency on the Google ``bq.py`` command line client. This submodule
162162
now uses ``httplib2`` and the Google ``apiclient`` and ``oauth2client`` API client

doc/source/whatsnew/v0.15.1.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ API changes
185185
2014-11-22 call AAPL141122C00110000 1.02
186186
2014-11-28 call AAPL141128C00110000 1.32
187187

188-
See the Options documentation in :ref:`Remote Data <remote_data.yahoo_options>`
189-
190188
.. _whatsnew_0151.datetime64_plotting:
191189

192190
- pandas now also registers the ``datetime64`` dtype in matplotlib's units registry
@@ -257,7 +255,7 @@ Enhancements
257255

258256
- Added support for 3-character ISO and non-standard country codes in :func:`io.wb.download()` (:issue:`8482`)
259257

260-
- :ref:`World Bank data requests <remote_data.wb>` now will warn/raise based
258+
- World Bank data requests now will warn/raise based
261259
on an ``errors`` argument, as well as a list of hard-coded country codes and
262260
the World Bank's JSON response. In prior versions, the error messages
263261
didn't look at the World Bank's JSON response. Problem-inducing input were

doc/source/whatsnew/v0.8.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Time series changes and improvements
5959
aggregation functions, and control over how the intervals and result labeling
6060
are defined. A suite of high performance Cython/C-based resampling functions
6161
(including Open-High-Low-Close) have also been implemented.
62-
- Revamp of :ref:`frequency aliases <timeseries.alias>` and support for
62+
- Revamp of :ref:`frequency aliases <timeseries.offset_aliases>` and support for
6363
**frequency shortcuts** like '15min', or '1h30min'
6464
- New :ref:`DatetimeIndex class <timeseries.datetimeindex>` supports both fixed
6565
frequency and irregular time

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3998,7 +3998,7 @@ def asfreq(self, freq, method=None, how=None, normalize=False):
39983998
converted : type of caller
39993999
40004000
To learn more about the frequency strings, please see `this link
4001-
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
4001+
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
40024002
"""
40034003
from pandas.tseries.resample import asfreq
40044004
return asfreq(self, freq, method=method, how=how, normalize=normalize)

pandas/io/gbq.py

+20-12
Original file line numberDiff line numberDiff line change
@@ -630,16 +630,20 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
630630
https://developers.google.com/api-client-library/python/apis/bigquery/v2
631631
632632
Authentication to the Google BigQuery service is via OAuth 2.0.
633+
633634
- If "private_key" is not provided:
634-
By default "application default credentials" are used.
635635
636-
.. versionadded:: 0.19.0
636+
By default "application default credentials" are used.
637+
638+
.. versionadded:: 0.19.0
639+
640+
If default application credentials are not found or are restrictive,
641+
user account credentials are used. In this case, you will be asked to
642+
grant permissions for product name 'pandas GBQ'.
637643
638-
If default application credentials are not found or are restrictive,
639-
user account credentials are used. In this case, you will be asked to
640-
grant permissions for product name 'pandas GBQ'.
641644
- If "private_key" is provided:
642-
Service account credentials will be used to authenticate.
645+
646+
Service account credentials will be used to authenticate.
643647
644648
Parameters
645649
----------
@@ -747,16 +751,20 @@ def to_gbq(dataframe, destination_table, project_id, chunksize=10000,
747751
https://developers.google.com/api-client-library/python/apis/bigquery/v2
748752
749753
Authentication to the Google BigQuery service is via OAuth 2.0.
754+
750755
- If "private_key" is not provided:
751-
By default "application default credentials" are used.
752756
753-
.. versionadded:: 0.19.0
757+
By default "application default credentials" are used.
758+
759+
.. versionadded:: 0.19.0
760+
761+
If default application credentials are not found or are restrictive,
762+
user account credentials are used. In this case, you will be asked to
763+
grant permissions for product name 'pandas GBQ'.
754764
755-
If default application credentials are not found or are restrictive,
756-
user account credentials are used. In this case, you will be asked to
757-
grant permissions for product name 'pandas GBQ'.
758765
- If "private_key" is provided:
759-
Service account credentials will be used to authenticate.
766+
767+
Service account credentials will be used to authenticate.
760768
761769
Parameters
762770
----------

0 commit comments

Comments
 (0)