Skip to content

DOC: cleaned references to pandas v0.15 and v0.16 in docs #17442

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
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion doc/source/10min.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ the quarter end:
Categoricals
------------

Since version 0.15, pandas can include categorical data in a ``DataFrame``. For full docs, see the
pandas can include categorical data in a ``DataFrame``. For full docs, see the
:ref:`categorical introduction <categorical>` and the :ref:`API documentation <api.categorical>`.

.. ipython:: python
Expand Down
15 changes: 3 additions & 12 deletions doc/source/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ See the :ref:`Indexing and Selecting Data <indexing>` for general indexing docum
should be avoided. See :ref:`Returning a View versus Copy
<indexing.view_versus_copy>`

.. warning::

In 0.15.0 ``Index`` has internally been refactored to no longer sub-class ``ndarray``
but instead subclass ``PandasObject``, similarly to the rest of the pandas objects. This should be
a transparent change with only very limited API implications (See the :ref:`Internal Refactoring <whatsnew_0150.refactoring>`)

See the :ref:`cookbook<cookbook.selection>` for some advanced strategies

.. _advanced.hierarchical:
Expand Down Expand Up @@ -638,12 +632,9 @@ In the following sub-sections we will highlite some other index types.
CategoricalIndex
~~~~~~~~~~~~~~~~

.. versionadded:: 0.16.1

We introduce a ``CategoricalIndex``, a new type of index object that is useful for supporting
indexing with duplicates. This is a container around a ``Categorical`` (introduced in v0.15.0)
and allows efficient indexing and storage of an index with a large number of duplicated elements. Prior to 0.16.1,
setting the index of a ``DataFrame/Series`` with a ``category`` dtype would convert this to regular object-based ``Index``.
``CategoricalIndex`` is a type of index that is useful for supporting
indexing with duplicates. This is a container around a ``Categorical``
and allows efficient indexing and storage of an index with a large number of duplicated elements.

.. ipython:: python

Expand Down
8 changes: 4 additions & 4 deletions doc/source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,6 @@ on an entire ``DataFrame`` or ``Series``, row- or column-wise, or elementwise.
Tablewise Function Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 0.16.2

``DataFrames`` and ``Series`` can of course just be passed into functions.
However, if the function needs to be called in a chain, consider using the :meth:`~DataFrame.pipe` method.
Compare the following
Expand Down Expand Up @@ -1860,8 +1858,10 @@ dtypes
------

The main types stored in pandas objects are ``float``, ``int``, ``bool``,
``datetime64[ns]`` and ``datetime64[ns, tz]`` (in >= 0.17.0), ``timedelta[ns]``, ``category`` (in >= 0.15.0), and ``object``. In addition these dtypes
have item sizes, e.g. ``int64`` and ``int32``. See :ref:`Series with TZ <timeseries.timezone_series>` for more detail on ``datetime64[ns, tz]`` dtypes.
``datetime64[ns]`` and ``datetime64[ns, tz]`` (in >= 0.17.0), ``timedelta[ns]``,
``category`` and ``object``. In addition these dtypes have item sizes, e.g.
``int64`` and ``int32``. See :ref:`Series with TZ <timeseries.timezone_series>`
for more detail on ``datetime64[ns, tz]`` dtypes.

A convenient :attr:`~DataFrame.dtypes` attribute for DataFrames returns a Series with the data type of each column.

Expand Down
64 changes: 10 additions & 54 deletions doc/source/categorical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
Categorical Data
****************

.. versionadded:: 0.15

.. note::
While there was `pandas.Categorical` in earlier versions, the ability to use
categorical data in `Series` and `DataFrame` is new.


This is an introduction to pandas categorical data type, including a short comparison
with R's ``factor``.

Expand Down Expand Up @@ -295,10 +288,6 @@ Sorting and Order

.. _categorical.sort:

.. warning::

The default for construction has changed in v0.16.0 to ``ordered=False``, from the prior implicit ``ordered=True``

If categorical data is ordered (``s.cat.ordered == True``), then the order of the categories has a
meaning and certain operations are possible. If the categorical is unordered, ``.min()/.max()`` will raise a `TypeError`.

Expand Down Expand Up @@ -803,13 +792,11 @@ Following table summarizes the results of ``Categoricals`` related concatenation
Getting Data In/Out
-------------------

.. versionadded:: 0.15.2
You can write data that contains ``category`` dtypes to a ``HDFStore``.
See :ref:`here <io.hdf5-categorical>` for an example and caveats.

Writing data (`Series`, `Frames`) to a HDF store that contains a ``category`` dtype was implemented
in 0.15.2. See :ref:`here <io.hdf5-categorical>` for an example and caveats.

Writing data to and reading data from *Stata* format files was implemented in
0.15.2. See :ref:`here <io.stata-categorical>` for an example and caveats.
It is also possible to write data to and reading data from *Stata* format files.
See :ref:`here <io.stata-categorical>` for an example and caveats.

Writing to a CSV file will convert the data, effectively removing any information about the
categorical (categories and ordering). So if you read back the CSV file you have to convert the
Expand Down Expand Up @@ -928,32 +915,6 @@ an ``object`` dtype is a constant times the length of the data.
s.astype('category').nbytes


Old style constructor usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~

In earlier versions than pandas 0.15, a `Categorical` could be constructed by passing in precomputed
`codes` (called then `labels`) instead of values with categories. The `codes` were interpreted as
pointers to the categories with `-1` as `NaN`. This type of constructor usage is replaced by
the special constructor :func:`Categorical.from_codes`.

Unfortunately, in some special cases, using code which assumes the old style constructor usage
will work with the current pandas version, resulting in subtle bugs:

.. code-block:: python

>>> cat = pd.Categorical([1,2], [1,2,3])
>>> # old version
>>> cat.get_values()
array([2, 3], dtype=int64)
>>> # new version
>>> cat.get_values()
array([1, 2], dtype=int64)

.. warning::
If you used `Categoricals` with older versions of pandas, please audit your code before
upgrading and change your code to use the :func:`~pandas.Categorical.from_codes`
constructor.

`Categorical` is not a `numpy` array
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -982,8 +943,7 @@ Dtype comparisons work:
dtype == np.str_
np.str_ == dtype

To check if a Series contains Categorical data, with pandas 0.16 or later, use
``hasattr(s, 'cat')``:
To check if a Series contains Categorical data, use ``hasattr(s, 'cat')``:

.. ipython:: python

Expand Down Expand Up @@ -1023,13 +983,13 @@ basic type) and applying along columns will also convert to object.
Categorical Index
~~~~~~~~~~~~~~~~~

.. versionadded:: 0.16.1

A new ``CategoricalIndex`` index type is introduced in version 0.16.1. See the
:ref:`advanced indexing docs <indexing.categoricalindex>` for a more detailed
``CategoricalIndex`` is a type of index that is useful for supporting
indexing with duplicates. This is a container around a ``Categorical``
and allows efficient indexing and storage of an index with a large number of duplicated elements.
See the :ref:`advanced indexing docs <indexing.categoricalindex>` for a more detailed
explanation.

Setting the index, will create create a ``CategoricalIndex``
Setting the index will create a ``CategoricalIndex``

.. ipython:: python

Expand All @@ -1041,10 +1001,6 @@ Setting the index, will create create a ``CategoricalIndex``
# This now sorts by the categories order
df.sort_index()

In previous versions (<0.16.1) there is no index of type ``category``, so
setting the index to categorical column will convert the categorical data to a
"normal" dtype first and therefore remove any custom ordering of the categories.

Side Effects
~~~~~~~~~~~~

Expand Down
2 changes: 0 additions & 2 deletions doc/source/comparison_with_r.rst
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,6 @@ For more details and examples see :ref:`the reshaping documentation
|factor|_
~~~~~~~~~

.. versionadded:: 0.15

pandas has a data type for categorical data.

.. code-block:: r
Expand Down
7 changes: 2 additions & 5 deletions doc/source/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -924,15 +924,12 @@ EWM has a ``min_periods`` argument, which has the same
meaning it does for all the ``.expanding`` and ``.rolling`` methods:
no output values will be set until at least ``min_periods`` non-null values
are encountered in the (expanding) window.
(This is a change from versions prior to 0.15.0, in which the ``min_periods``
argument affected only the ``min_periods`` consecutive entries starting at the
first non-null value.)

EWM also has an ``ignore_na`` argument, which deterines how
EWM also has an ``ignore_na`` argument, which determines how
intermediate null values affect the calculation of the weights.
When ``ignore_na=False`` (the default), weights are calculated based on absolute
positions, so that intermediate null values affect the result.
When ``ignore_na=True`` (which reproduces the behavior in versions prior to 0.15.0),
When ``ignore_na=True``,
weights are calculated by ignoring intermediate null values.
For example, assuming ``adjust=True``, if ``ignore_na=False``, the weighted
average of ``3, NaN, 5`` would be calculated as
Expand Down
6 changes: 0 additions & 6 deletions doc/source/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ Panels

pf = pd.Panel({'df1':df1,'df2':df2,'df3':df3});pf

#Assignment using Transpose (pandas < 0.15)
pf = pf.transpose(2,0,1)
pf['E'] = pd.DataFrame(data, rng, cols)
pf = pf.transpose(1,2,0);pf

#Direct assignment (pandas > 0.15)
pf.loc[:,:,'F'] = pd.DataFrame(data, rng, cols);pf

`Mask a panel by using np.where and then reconstructing the panel with the new masked values
Expand Down
2 changes: 0 additions & 2 deletions doc/source/dsintro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ available to insert at a particular location in the columns:
Assigning New Columns in Method Chains
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 0.16.0

Inspired by `dplyr's
<http://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html#mutate>`__
``mutate`` verb, DataFrame has an :meth:`~pandas.DataFrame.assign`
Expand Down
4 changes: 2 additions & 2 deletions doc/source/gotchas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Frequently Asked Questions (FAQ)

DataFrame memory usage
----------------------
As of pandas version 0.15.0, the memory usage of a dataframe (including
the index) is shown when accessing the ``info`` method of a dataframe. A
The memory usage of a dataframe (including the index)
is shown when accessing the ``info`` method of a dataframe. A
configuration option, ``display.memory_usage`` (see :ref:`options`),
specifies if the dataframe's memory usage will be displayed when
invoking the ``df.info()`` method.
Expand Down
14 changes: 0 additions & 14 deletions doc/source/indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ advanced indexing.
should be avoided. See :ref:`Returning a View versus Copy
<indexing.view_versus_copy>`

.. warning::

In 0.15.0 ``Index`` has internally been refactored to no longer subclass ``ndarray``
but instead subclass ``PandasObject``, similarly to the rest of the pandas objects. This should be
a transparent change with only very limited API implications (See the :ref:`Internal Refactoring <whatsnew_0150.refactoring>`)

.. warning::

Indexing on an integer-based Index with floats has been clarified in 0.18.0, for a summary of the changes, see :ref:`here <whatsnew_0180.float_indexers>`.
Expand Down Expand Up @@ -660,7 +654,6 @@ For getting *multiple* indexers, using ``.get_indexer``

Selecting Random Samples
------------------------
.. versionadded::0.16.1

A random selection of rows or columns from a Series, DataFrame, or Panel with the :meth:`~DataFrame.sample` method. The method will sample rows by default, and accepts a specific number of rows/columns to return, or a fraction of rows.

Expand Down Expand Up @@ -1510,8 +1503,6 @@ See :ref:`Advanced Indexing <advanced>` for usage of MultiIndexes.
ind.name = "bob"
ind

.. versionadded:: 0.15.0

``set_names``, ``set_levels``, and ``set_labels`` also take an optional
`level`` argument

Expand All @@ -1527,11 +1518,6 @@ Set operations on Index objects

.. _indexing.set_ops:

.. warning::

In 0.15.0. the set operations ``+`` and ``-`` were deprecated in order to provide these for numeric type operations on certain
index types. ``+`` can be replace by ``.union()`` or ``|``, and ``-`` by ``.difference()``.

The two main operations are ``union (|)``, ``intersection (&)``
These can be directly called as instance methods or used via overloaded
operators. Difference is provided via the ``.difference()`` method.
Expand Down
20 changes: 8 additions & 12 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Instructions for installing from source,
Python version support
----------------------

Officially Python 2.7, 3.4, 3.5, and 3.6
Officially Python 2.7, 3.5, and 3.6.

Installing pandas
-----------------
Expand Down Expand Up @@ -183,21 +183,17 @@ installed), make sure you have `pytest

>>> import pandas as pd
>>> pd.test()
Running unit tests for pandas
pandas version 0.18.0
numpy version 1.10.2
pandas is installed in pandas
Python version 2.7.11 |Continuum Analytics, Inc.|
(default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)]
nose version 1.3.7
running: pytest --skip-slow --skip-network C:\Users\TP\Anaconda3\envs\py36\lib\site-packages\pandas
============================= test session starts =============================
platform win32 -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: C:\Users\TP\Documents\Python\pandasdev\pandas, inifile: setup.cfg
collected 12145 items / 3 skipped

..................................................................S......
........S................................................................
.........................................................................

----------------------------------------------------------------------
Ran 9252 tests in 368.339s

OK (SKIP=117)
==================== 12130 passed, 12 skipped in 368.339 seconds =====================

Dependencies
------------
Expand Down
Loading