Skip to content

Commit c2c7aee

Browse files
DOC: remove usage of code-block in docstrings (#3430)
1 parent 2d23cce commit c2c7aee

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed

pandas/core/series.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,21 +2094,8 @@ def isin(self, values):
20942094
----------
20952095
values : list-like
20962096
The sequence of values to test. Passing in a single string will
2097-
raise a ``TypeError``:
2098-
2099-
.. code-block:: python
2100-
2101-
from pandas import Series
2102-
s = Series(list('abc'))
2103-
s.isin('a')
2104-
2105-
Instead, turn a single string into a ``list`` of one element:
2106-
2107-
.. code-block:: python
2108-
2109-
from pandas import Series
2110-
s = Series(list('abc'))
2111-
s.isin(['a'])
2097+
raise a ``TypeError``. Instead, turn a single string into a
2098+
``list`` of one element.
21122099
21132100
Returns
21142101
-------
@@ -2122,6 +2109,26 @@ def isin(self, values):
21222109
See Also
21232110
--------
21242111
pandas.DataFrame.isin
2112+
2113+
Examples
2114+
--------
2115+
2116+
>>> s = pd.Series(list('abc'))
2117+
>>> s.isin(['a', 'c', 'e'])
2118+
0 True
2119+
1 False
2120+
2 True
2121+
dtype: bool
2122+
2123+
Passing a single string as ``s.isin('a')`` will raise an error. Use
2124+
a list of one element instead:
2125+
2126+
>>> s.isin(['a'])
2127+
0 True
2128+
1 False
2129+
2 False
2130+
dtype: bool
2131+
21252132
"""
21262133
if not com.is_list_like(values):
21272134
raise TypeError("only list-like objects are allowed to be passed"

pandas/io/html.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -759,20 +759,16 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None,
759759
This is a dictionary of attributes that you can pass to use to identify
760760
the table in the HTML. These are not checked for validity before being
761761
passed to lxml or Beautiful Soup. However, these attributes must be
762-
valid HTML table attributes to work correctly. For example,
763-
764-
.. code-block:: python
765-
766-
attrs = {'id': 'table'}
767-
762+
valid HTML table attributes to work correctly. For example, ::
763+
764+
attrs = {'id': 'table'}
765+
768766
is a valid attribute dictionary because the 'id' HTML tag attribute is
769767
a valid HTML attribute for *any* HTML tag as per `this document
770-
<http://www.w3.org/TR/html-markup/global-attributes.html>`__.
771-
772-
.. code-block:: python
773-
774-
attrs = {'asdf': 'table'}
775-
768+
<http://www.w3.org/TR/html-markup/global-attributes.html>`__. ::
769+
770+
attrs = {'asdf': 'table'}
771+
776772
is *not* a valid attribute dictionary because 'asdf' is not a valid
777773
HTML attribute even if it is a valid XML attribute. Valid HTML 4.01
778774
table attributes can be found `here

0 commit comments

Comments
 (0)