Skip to content

Commit

Permalink
Merge pull request #10076 from sinhrks/rn20150507
Browse files Browse the repository at this point in the history
DOC: Fix v0.16.1 release note
  • Loading branch information
jorisvandenbossche committed May 7, 2015
2 parents 9c99566 + 2ff07f1 commit c9bf162
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
3 changes: 1 addition & 2 deletions doc/source/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ not check (or care) whether the levels themselves are sorted. Fortunately, the
constructors ``from_tuples`` and ``from_arrays`` ensure that this is true, but
if you compute the levels and labels yourself, please be careful.


.. _:
.. _ref-subclassing-pandas:

Subclassing pandas Data Structures
----------------------------------
Expand Down
67 changes: 42 additions & 25 deletions doc/source/whatsnew/v0.16.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Highlights include:

- ``BusinessHour`` offset is supported, see :ref:`here <timeseries.businesshour>`

- Further enhancement to the ``.str`` accessor to make string operations easier, see :ref:`here <whatsnew_0161.enhancements.string>`

.. contents:: What's new in v0.16.1
:local:
:backlinks: none
Expand All @@ -37,34 +39,9 @@ Enhancements
Timestamp('2014-08-01 07:00') + BusinessHour()
Timestamp('2014-08-01 16:30') + BusinessHour()

- Added ``StringMethods.capitalize()`` and ``swapcase`` which behave as the same as standard ``str`` (:issue:`9766`)
- ``DataFrame.diff`` now takes an ``axis`` parameter that determines the direction of differencing (:issue:`9727`)
- Added ``StringMethods`` (.str accessor) to ``Index`` (:issue:`9068`)
- Added ``StringMethods.normalize()`` which behaves the same as standard :func:`unicodedata.normalizes` (:issue:`10031`)

- Added ``StringMethods.partition()`` and ``rpartition()`` which behave as the same as standard ``str`` (:issue:`9773`)
- Allow clip, clip_lower, and clip_upper to accept array-like arguments as thresholds (:issue:`6966`). These methods now have an ``axis`` parameter which determines how the Series or DataFrame will be aligned with the threshold(s).

The ``.str`` accessor is now available for both ``Series`` and ``Index``.

.. ipython:: python

idx = Index([' jack', 'jill ', ' jesse ', 'frank'])
idx.str.strip()

One special case for the `.str` accessor on ``Index`` is that if a string method returns ``bool``, the ``.str`` accessor
will return a ``np.array`` instead of a boolean ``Index`` (:issue:`8875`). This enables the following expression
to work naturally:


.. ipython:: python

idx = Index(['a1', 'a2', 'b1', 'b2'])
s = Series(range(4), index=idx)
s
idx.str.startswith('a')
s[s.index.str.startswith('a')]

- ``DataFrame.mask()`` and ``Series.mask()`` now support same keywords as ``where`` (:issue:`8801`)

- ``drop`` function can now accept ``errors`` keyword to suppress ``ValueError`` raised when any of label does not exist in the target data. (:issue:`6736`)
Expand Down Expand Up @@ -199,6 +176,46 @@ when sampling from rows.
df = DataFrame({'col1':[9,8,7,6], 'weight_column':[0.5, 0.4, 0.1, 0]})
df.sample(n=3, weights='weight_column')


.. _whatsnew_0161.enhancements.string:

String Methods Enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^

:ref:`Continuing from v0.16.0 <whatsnew_0160.enhancements.string>`, following
enhancements are performed to make string operation easier.

- Following new methods are accesible via ``.str`` accessor to apply the function to each values. This is intended to make it more consistent with standard methods on strings. (:issue:`9766`, :issue:`9773`, :issue:`10031`)

================ =============== =============== =============== ================
.. .. Methods .. ..
================ =============== =============== =============== ================
``capitalize()`` ``swapcase()`` ``normalize()`` ``partition()`` ``rpartition()``
================ =============== =============== =============== ================



- Added ``StringMethods`` (.str accessor) to ``Index`` (:issue:`9068`)

The ``.str`` accessor is now available for both ``Series`` and ``Index``.

.. ipython:: python

idx = Index([' jack', 'jill ', ' jesse ', 'frank'])
idx.str.strip()

One special case for the `.str` accessor on ``Index`` is that if a string method returns ``bool``, the ``.str`` accessor
will return a ``np.array`` instead of a boolean ``Index`` (:issue:`8875`). This enables the following expression
to work naturally:

.. ipython:: python

idx = Index(['a1', 'a2', 'b1', 'b2'])
s = Series(range(4), index=idx)
s
idx.str.startswith('a')
s[s.index.str.startswith('a')]

.. _whatsnew_0161.api:

API changes
Expand Down

0 comments on commit c9bf162

Please sign in to comment.