Skip to content

Commit d4560fb

Browse files
committed
DOC: cookbook/v0.11.1 updates
1 parent df44969 commit d4560fb

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

doc/source/cookbook.rst

+13
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ Levels
9292
`Flatten Hierarchical columns
9393
<http://stackoverflow.com/questions/14507794/python-pandas-how-to-flatten-a-hierarchical-index-in-columns>`__
9494

95+
.. _cookbook.missing_data:
96+
97+
Missing Data
98+
------------
99+
100+
The :ref:`missing data <missing_data>` docs.
101+
102+
Replace
103+
~~~~~~~
104+
105+
`Using replace with backrefs
106+
<http://stackoverflow.com/questions/16818871/extracting-value-and-creating-new-column-out-of-it>`__
107+
95108
.. _cookbook.grouping:
96109

97110
Grouping

doc/source/missing_data.rst

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ pandas.
2323
NumPy will soon be able to provide a native NA type solution (similar to R)
2424
performant enough to be used in pandas.
2525

26+
See the :ref:`cookbook<cookbook.missing_data>` for some advanced strategies
27+
2628
Missing data basics
2729
-------------------
2830

doc/source/v0.11.1.txt

+20-18
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Enhancements
7878
- ``pd.read_html()`` can now parse HTML strings, files or urls and return
7979
DataFrames, courtesy of @cpcloud. (GH3477_, GH3605_, GH3606_, GH3616_).
8080
It works with a *single* parser backend: BeautifulSoup4 + html5lib
81+
8182
- You can use ``pd.read_html()`` to read the output from ``DataFrame.to_html()`` like so
8283

8384
.. ipython :: python
@@ -110,6 +111,25 @@ Enhancements
110111
- ``DataFrame.replace()`` now allows regular expressions on contained
111112
``Series`` with object dtype. See the examples section in the regular docs
112113
: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+
113133
- ``Series.str`` now supports iteration (GH3638_). You can iterate over the
114134
individual elements of each string in the ``Series``. Each iteration yields
115135
yields a ``Series`` with either a single character at each index of the
@@ -190,24 +210,6 @@ Bug Fixes
190210
- Duplicate indexes with and empty DataFrame.from_records will return a correct frame (GH3562_)
191211
- Concat to produce a non-unique columns when duplicates are across dtypes is fixed (GH3602_)
192212

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-
211213
See the `full release notes
212214
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
213215
on GitHub for a complete list.

0 commit comments

Comments
 (0)