Skip to content

Commit 342423f

Browse files
committed
DOC: use code block for shorter error message
1 parent 2f70a1f commit 342423f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/source/missing_data.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,12 @@ You can also operate on the DataFrame in place
602602
argument to ``replace`` (``to_replace``) must match the type of the value
603603
being replaced type. For example,
604604

605-
.. ipython:: python
606-
:okexcept:
605+
.. code-block:: python
607606
608607
s = Series([True, False, True])
609-
s.replace({'a string': 'new value', True: False})
608+
s.replace({'a string': 'new value', True: False}) # raises
609+
610+
TypeError: Cannot compare types 'ndarray(dtype=bool)' and 'str'
610611
611612
will raise a ``TypeError`` because one of the ``dict`` keys is not of the
612613
correct type for replacement.

0 commit comments

Comments
 (0)