Skip to content

Commit dd1ff3e

Browse files
committed
DOC: reorg / update v0.16.0.txt docs
1 parent d6774a7 commit dd1ff3e

File tree

1 file changed

+86
-85
lines changed

1 file changed

+86
-85
lines changed

doc/source/whatsnew/v0.16.0.txt

+86-85
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ users upgrade to this version.
2020
New features
2121
~~~~~~~~~~~~
2222

23+
.. _whatsnew_0160.enhancements:
24+
2325
- Reindex now supports ``method='nearest'`` for frames or series with a monotonic increasing or decreasing index (:issue:`9258`):
2426

2527
.. ipython:: python
@@ -29,7 +31,41 @@ New features
2931

3032
This method is also exposed by the lower level ``Index.get_indexer`` and ``Index.get_loc`` methods.
3133

32-
- DataFrame assign method
34+
- Paths beginning with ~ will now be expanded to begin with the user's home directory (:issue:`9066`)
35+
- Added time interval selection in ``get_data_yahoo`` (:issue:`9071`)
36+
- Added ``Series.str.slice_replace()``, which previously raised ``NotImplementedError`` (:issue:`8888`)
37+
- Added ``Timestamp.to_datetime64()`` to complement ``Timedelta.to_timedelta64()`` (:issue:`9255`)
38+
- ``tseries.frequencies.to_offset()`` now accepts ``Timedelta`` as input (:issue:`9064`)
39+
- Lag parameter was added to the autocorrelation method of ``Series``, defaults to lag-1 autocorrelation (:issue:`9192`)
40+
- ``Timedelta`` will now accept ``nanoseconds`` keyword in constructor (:issue:`9273`)
41+
- SQL code now safely escapes table and column names (:issue:`8986`)
42+
43+
- Added auto-complete for ``Series.str.<tab>``, ``Series.dt.<tab>`` and ``Series.cat.<tab>`` (:issue:`9322`)
44+
- Added ``StringMethods.isalnum()``, ``isalpha()``, ``isdigit()``, ``isspace()``, ``islower()``,
45+
``isupper()``, ``istitle()`` which behave as the same as standard ``str`` (:issue:`9282`)
46+
47+
- Added ``StringMethods.find()`` and ``rfind()`` which behave as the same as standard ``str`` (:issue:`9386`)
48+
49+
- ``Index.get_indexer`` now supports ``method='pad'`` and ``method='backfill'`` even for any target array, not just monotonic targets. These methods also work for monotonic decreasing as well as monotonic increasing indexes (:issue:`9258`).
50+
- ``Index.asof`` now works on all index types (:issue:`9258`).
51+
52+
- Added ``StringMethods.isnumeric`` and ``isdecimal`` which behave as the same as standard ``str`` (:issue:`9439`)
53+
- The ``read_excel()`` function's :ref:`sheetname <_io.specifying_sheets>` argument now accepts a list and ``None``, to get multiple or all sheets respectively. If more than one sheet is specified, a dictionary is returned. (:issue:`9450`)
54+
55+
.. code-block:: python
56+
57+
# Returns the 1st and 4th sheet, as a dictionary of DataFrames.
58+
pd.read_excel('path_to_file.xls',sheetname=['Sheet1',3])
59+
60+
- A ``verbose`` argument has been augmented in ``io.read_excel()``, defaults to False. Set to True to print sheet names as they are parsed. (:issue:`9450`)
61+
- Added ``StringMethods.ljust()`` and ``rjust()`` which behave as the same as standard ``str`` (:issue:`9352`)
62+
- ``StringMethods.pad()`` and ``center()`` now accept ``fillchar`` option to specify filling character (:issue:`9352`)
63+
- Added ``StringMethods.zfill()`` which behave as the same as standard ``str`` (:issue:`9387`)
64+
65+
DataFrame Assign
66+
~~~~~~~~~~~~~~~~
67+
68+
.. _whatsnew_0160.enhancements.assign:
3369

3470
Inspired by `dplyr's
3571
<http://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html#mutate>`__ ``mutate`` verb, DataFrame has a new
@@ -71,6 +107,55 @@ calculate the ratio, and plot
71107

72108
See the :ref:`documentation <dsintro.chained_assignment>` for more. (:issue:`9229`)
73109

110+
111+
Interaction with scipy.sparse
112+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113+
114+
.. _whatsnew_0160.enhancements.sparse:
115+
116+
Added :meth:`SparseSeries.to_coo` and :meth:`SparseSeries.from_coo` methods (:issue:`8048`) for converting to and from ``scipy.sparse.coo_matrix`` instances (see :ref:`here <sparse.scipysparse>`). For example, given a SparseSeries with MultiIndex we can convert to a `scipy.sparse.coo_matrix` by specifying the row and column labels as index levels:
117+
118+
.. ipython:: python
119+
120+
from numpy import nan
121+
s = Series([3.0, nan, 1.0, 3.0, nan, nan])
122+
s.index = MultiIndex.from_tuples([(1, 2, 'a', 0),
123+
(1, 2, 'a', 1),
124+
(1, 1, 'b', 0),
125+
(1, 1, 'b', 1),
126+
(2, 1, 'b', 0),
127+
(2, 1, 'b', 1)],
128+
names=['A', 'B', 'C', 'D'])
129+
130+
s
131+
132+
# SparseSeries
133+
ss = s.to_sparse()
134+
ss
135+
136+
A, rows, columns = ss.to_coo(row_levels=['A', 'B'],
137+
column_levels=['C', 'D'],
138+
sort_labels=False)
139+
140+
A
141+
A.todense()
142+
rows
143+
columns
144+
145+
The from_coo method is a convenience method for creating a ``SparseSeries``
146+
from a ``scipy.sparse.coo_matrix``:
147+
148+
.. ipython:: python
149+
150+
from scipy import sparse
151+
A = sparse.coo_matrix(([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])),
152+
shape=(3, 4))
153+
A
154+
A.todense()
155+
156+
ss = SparseSeries.from_coo(A)
157+
ss
158+
74159
.. _whatsnew_0160.api:
75160

76161
.. _whatsnew_0160.api_breaking:
@@ -278,90 +363,6 @@ Deprecations
278363
.. _whatsnew_0160.deprecations:
279364

280365

281-
Enhancements
282-
~~~~~~~~~~~~
283-
284-
.. _whatsnew_0160.enhancements:
285-
286-
- Paths beginning with ~ will now be expanded to begin with the user's home directory (:issue:`9066`)
287-
- Added time interval selection in ``get_data_yahoo`` (:issue:`9071`)
288-
- Added ``Series.str.slice_replace()``, which previously raised ``NotImplementedError`` (:issue:`8888`)
289-
- Added ``Timestamp.to_datetime64()`` to complement ``Timedelta.to_timedelta64()`` (:issue:`9255`)
290-
- ``tseries.frequencies.to_offset()`` now accepts ``Timedelta`` as input (:issue:`9064`)
291-
- Lag parameter was added to the autocorrelation method of ``Series``, defaults to lag-1 autocorrelation (:issue:`9192`)
292-
- ``Timedelta`` will now accept ``nanoseconds`` keyword in constructor (:issue:`9273`)
293-
- SQL code now safely escapes table and column names (:issue:`8986`)
294-
295-
- Added auto-complete for ``Series.str.<tab>``, ``Series.dt.<tab>`` and ``Series.cat.<tab>`` (:issue:`9322`)
296-
- Added ``StringMethods.isalnum()``, ``isalpha()``, ``isdigit()``, ``isspace()``, ``islower()``,
297-
``isupper()``, ``istitle()`` which behave as the same as standard ``str`` (:issue:`9282`)
298-
299-
- Added ``StringMethods.find()`` and ``rfind()`` which behave as the same as standard ``str`` (:issue:`9386`)
300-
301-
- ``Index.get_indexer`` now supports ``method='pad'`` and ``method='backfill'`` even for any target array, not just monotonic targets. These methods also work for monotonic decreasing as well as monotonic increasing indexes (:issue:`9258`).
302-
- ``Index.asof`` now works on all index types (:issue:`9258`).
303-
304-
- Added ``StringMethods.isnumeric`` and ``isdecimal`` which behave as the same as standard ``str`` (:issue:`9439`)
305-
- The ``read_excel()`` function's :ref:`sheetname <_io.specifying_sheets>` argument now accepts a list and ``None``, to get multiple or all sheets respectively. If more than one sheet is specified, a dictionary is returned. (:issue:`9450`)
306-
307-
.. code-block:: python
308-
309-
# Returns the 1st and 4th sheet, as a dictionary of DataFrames.
310-
pd.read_excel('path_to_file.xls',sheetname=['Sheet1',3])
311-
312-
- A ``verbose`` argument has been augmented in ``io.read_excel()``, defaults to False. Set to True to print sheet names as they are parsed. (:issue:`9450`)
313-
- Added ``StringMethods.ljust()`` and ``rjust()`` which behave as the same as standard ``str`` (:issue:`9352`)
314-
- ``StringMethods.pad()`` and ``center()`` now accept ``fillchar`` option to specify filling character (:issue:`9352`)
315-
- Added ``StringMethods.zfill()`` which behave as the same as standard ``str`` (:issue:`9387`)
316-
317-
Interaction with scipy.sparse
318-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319-
320-
.. _whatsnew_0160.enhancements.sparse:
321-
322-
Added :meth:`SparseSeries.to_coo` and :meth:`SparseSeries.from_coo` methods (:issue:`8048`) for converting to and from ``scipy.sparse.coo_matrix`` instances (see :ref:`here <sparse.scipysparse>`). For example, given a SparseSeries with MultiIndex we can convert to a `scipy.sparse.coo_matrix` by specifying the row and column labels as index levels:
323-
324-
.. ipython:: python
325-
326-
from numpy import nan
327-
s = Series([3.0, nan, 1.0, 3.0, nan, nan])
328-
s.index = MultiIndex.from_tuples([(1, 2, 'a', 0),
329-
(1, 2, 'a', 1),
330-
(1, 1, 'b', 0),
331-
(1, 1, 'b', 1),
332-
(2, 1, 'b', 0),
333-
(2, 1, 'b', 1)],
334-
names=['A', 'B', 'C', 'D'])
335-
336-
s
337-
338-
# SparseSeries
339-
ss = s.to_sparse()
340-
ss
341-
342-
A, rows, columns = ss.to_coo(row_levels=['A', 'B'],
343-
column_levels=['C', 'D'],
344-
sort_labels=False)
345-
346-
A
347-
A.todense()
348-
rows
349-
columns
350-
351-
The from_coo method is a convenience method for creating a ``SparseSeries``
352-
from a ``scipy.sparse.coo_matrix``:
353-
354-
.. ipython:: python
355-
356-
from scipy import sparse
357-
A = sparse.coo_matrix(([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])),
358-
shape=(3, 4))
359-
A
360-
A.todense()
361-
362-
ss = SparseSeries.from_coo(A)
363-
ss
364-
365366
Performance
366367
~~~~~~~~~~~
367368

0 commit comments

Comments
 (0)