We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f70a1f commit 342423fCopy full SHA for 342423f
doc/source/missing_data.rst
@@ -602,11 +602,12 @@ You can also operate on the DataFrame in place
602
argument to ``replace`` (``to_replace``) must match the type of the value
603
being replaced type. For example,
604
605
- .. ipython:: python
606
- :okexcept:
+ .. code-block:: python
607
608
s = Series([True, False, True])
609
- s.replace({'a string': 'new value', True: False})
+ s.replace({'a string': 'new value', True: False}) # raises
+
610
+ TypeError: Cannot compare types 'ndarray(dtype=bool)' and 'str'
611
612
will raise a ``TypeError`` because one of the ``dict`` keys is not of the
613
correct type for replacement.
0 commit comments