You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
``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.
- 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:
33
69
34
70
Inspired by `dplyr's
35
71
<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
71
107
72
108
See the :ref:`documentation <dsintro.chained_assignment>` for more. (:issue:`9229`)
73
109
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``
``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.
- 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``
0 commit comments