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
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.16.0.txt
+40-11
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ Highlights include:
14
14
- Backwards incompatible change to ``Timedelta`` to conform the ``.seconds`` attribute with ``datetime.timedelta``, see :ref:`here <whatsnew_0160.api_breaking.timedelta>`
15
15
- Changes to the ``.loc`` slicing API to conform with the behavior of ``.ix`` see :ref:`here <whatsnew_0160.api_breaking.indexing>`
16
16
- Changes to the default for ordering in the ``Categorical`` constructor, see :ref:`here <whatsnew_0160.api_breaking.categorical>`
17
+
- Enhancement to the ``.str`` accessor to make string operations easier, see :ref:`here <whatsnew_0160.enhancements.string>`
17
18
18
19
Check the :ref:`API Changes <whatsnew_0160.api>` and :ref:`deprecations <whatsnew_0160.deprecations>` before updating.
19
20
@@ -120,6 +121,45 @@ from a ``scipy.sparse.coo_matrix``:
120
121
ss = SparseSeries.from_coo(A)
121
122
ss
122
123
124
+
.. _whatsnew_0160.enhancements.string:
125
+
126
+
String Methods Enhancements
127
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
+
129
+
- 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:`9282`, :issue:`9352`, :issue:`9386`, :issue:`9387`, :issue:`9439`)
- :meth:`Series.str.pad` and :meth:`Series.str.center` now accept ``fillchar`` option to specify filling character (:issue:`9352`)
147
+
148
+
.. ipython:: python
149
+
150
+
s = Series(['12', '300', '25'])
151
+
s.str.pad(5, fillchar='_')
152
+
153
+
154
+
- Added :meth:`Series.str.slice_replace`, which previously raised ``NotImplementedError`` (:issue:`8888`)
155
+
156
+
.. ipython:: python
157
+
158
+
s = Series(['ABCD', 'EFGH', 'IJK'])
159
+
s.str.slice_replace(1, 3, 'X')
160
+
# replaced with empty char
161
+
s.str.slice_replace(0, 1)
162
+
123
163
.. _whatsnew_0160.enhancements.other:
124
164
125
165
Other enhancements
@@ -137,23 +177,15 @@ Other enhancements
137
177
- Allow Stata files to be read incrementally with an iterator; support for long strings in Stata files. See the docs :ref:`here<io.stata_reader>`. (issue:`9493`:)
138
178
- Paths beginning with ~ will now be expanded to begin with the user's home directory (:issue:`9066`)
139
179
- Added time interval selection in ``get_data_yahoo`` (:issue:`9071`)
140
-
- Added ``Series.str.slice_replace()``, which previously raised ``NotImplementedError`` (:issue:`8888`)
141
180
- Added ``Timestamp.to_datetime64()`` to complement ``Timedelta.to_timedelta64()`` (:issue:`9255`)
142
181
- ``tseries.frequencies.to_offset()`` now accepts ``Timedelta`` as input (:issue:`9064`)
143
182
- Lag parameter was added to the autocorrelation method of ``Series``, defaults to lag-1 autocorrelation (:issue:`9192`)
144
183
- ``Timedelta`` will now accept ``nanoseconds`` keyword in constructor (:issue:`9273`)
145
184
- SQL code now safely escapes table and column names (:issue:`8986`)
146
185
147
186
- Added auto-complete for ``Series.str.<tab>``, ``Series.dt.<tab>`` and ``Series.cat.<tab>`` (:issue:`9322`)
``isupper()``, ``istitle()`` which behave as the same as standard ``str`` (:issue:`9282`)
150
-
151
-
- Added ``StringMethods.find()`` and ``rfind()`` which behave as the same as standard ``str`` (:issue:`9386`)
152
-
153
187
- ``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`).
154
188
- ``Index.asof`` now works on all index types (:issue:`9258`).
155
-
156
-
- Added ``StringMethods.isnumeric`` and ``isdecimal`` which behave as the same as standard ``str`` (:issue:`9439`)
157
189
- 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`)
- 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`)
165
-
- Added ``StringMethods.ljust()`` and ``rjust()`` which behave as the same as standard ``str`` (:issue:`9352`)
166
-
- ``StringMethods.pad()`` and ``center()`` now accept ``fillchar`` option to specify filling character (:issue:`9352`)
167
-
- Added ``StringMethods.zfill()`` which behave as the same as standard ``str`` (:issue:`9387`)
168
197
- Added ``days_in_month`` (compatibility alias ``daysinmonth``) property to ``Timestamp``, ``DatetimeIndex``, ``Period``, ``PeriodIndex``, and ``Series.dt`` (:issue:`9572`)
169
198
- Added ``decimal`` option in ``to_csv`` to provide formatting for non-'.' decimal separators (:issue:`781`)
170
199
- Added ``normalize`` option for ``Timestamp`` to normalized to midnight (:issue:`8794`)
0 commit comments