@@ -78,6 +78,7 @@ Enhancements
78
78
- ``pd.read_html()`` can now parse HTML strings, files or urls and return
79
79
DataFrames, courtesy of @cpcloud. (GH3477_, GH3605_, GH3606_, GH3616_).
80
80
It works with a *single* parser backend: BeautifulSoup4 + html5lib
81
+
81
82
- You can use ``pd.read_html()`` to read the output from ``DataFrame.to_html()`` like so
82
83
83
84
.. ipython :: python
@@ -110,6 +111,25 @@ Enhancements
110
111
- ``DataFrame.replace()`` now allows regular expressions on contained
111
112
``Series`` with object dtype. See the examples section in the regular docs
112
113
:ref:`Replacing via String Expression <missing_data.replace_expression>`
114
+
115
+ For example you can do
116
+
117
+ .. ipython :: python
118
+
119
+ df = DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
120
+ df.replace(regex=r'\s*\.\s*', value=nan)
121
+
122
+ to replace all occurrences of the string ``'.'`` with zero or more
123
+ instances of surrounding whitespace with ``NaN``.
124
+
125
+ Regular string replacement still works as expected. For example, you can do
126
+
127
+ .. ipython :: python
128
+
129
+ df.replace('.', nan)
130
+
131
+ to replace all occurrences of the string ``'.'`` with ``NaN``.
132
+
113
133
- ``Series.str`` now supports iteration (GH3638_). You can iterate over the
114
134
individual elements of each string in the ``Series``. Each iteration yields
115
135
yields a ``Series`` with either a single character at each index of the
@@ -190,24 +210,6 @@ Bug Fixes
190
210
- Duplicate indexes with and empty DataFrame.from_records will return a correct frame (GH3562_)
191
211
- Concat to produce a non-unique columns when duplicates are across dtypes is fixed (GH3602_)
192
212
193
- For example you can do
194
-
195
- .. ipython :: python
196
-
197
- df = DataFrame({'a': list('ab..'), 'b': [1, 2, 3, 4]})
198
- df.replace(regex=r'\s*\.\s*', value=nan)
199
-
200
- to replace all occurrences of the string ``'.'`` with zero or more
201
- instances of surrounding whitespace with ``NaN``.
202
-
203
- Regular string replacement still works as expected. For example, you can do
204
-
205
- .. ipython :: python
206
-
207
- df.replace('.', nan)
208
-
209
- to replace all occurrences of the string ``'.'`` with ``NaN``.
210
-
211
213
See the `full release notes
212
214
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
213
215
on GitHub for a complete list.
0 commit comments