Skip to content

Commit 7796ac5

Browse files
authored
DOC: cancel replace's doc list item text bold effect (pandas-dev#43955)
1 parent f3fbd0f commit 7796ac5

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

pandas/core/shared_docs.py

+41-41
Original file line numberDiff line numberDiff line change
@@ -414,51 +414,51 @@
414414
* numeric, str or regex:
415415
416416
- numeric: numeric values equal to `to_replace` will be
417-
replaced with `value`
417+
replaced with `value`
418418
- str: string exactly matching `to_replace` will be replaced
419-
with `value`
419+
with `value`
420420
- regex: regexs matching `to_replace` will be replaced with
421-
`value`
421+
`value`
422422
423423
* list of str, regex, or numeric:
424424
425425
- First, if `to_replace` and `value` are both lists, they
426-
**must** be the same length.
426+
**must** be the same length.
427427
- Second, if ``regex=True`` then all of the strings in **both**
428-
lists will be interpreted as regexs otherwise they will match
429-
directly. This doesn't matter much for `value` since there
430-
are only a few possible substitution regexes you can use.
428+
lists will be interpreted as regexs otherwise they will match
429+
directly. This doesn't matter much for `value` since there
430+
are only a few possible substitution regexes you can use.
431431
- str, regex and numeric rules apply as above.
432432
433433
* dict:
434434
435435
- Dicts can be used to specify different replacement values
436-
for different existing values. For example,
437-
``{{'a': 'b', 'y': 'z'}}`` replaces the value 'a' with 'b' and
438-
'y' with 'z'. To use a dict in this way the `value`
439-
parameter should be `None`.
436+
for different existing values. For example,
437+
``{{'a': 'b', 'y': 'z'}}`` replaces the value 'a' with 'b' and
438+
'y' with 'z'. To use a dict in this way the `value`
439+
parameter should be `None`.
440440
- For a DataFrame a dict can specify that different values
441-
should be replaced in different columns. For example,
442-
``{{'a': 1, 'b': 'z'}}`` looks for the value 1 in column 'a'
443-
and the value 'z' in column 'b' and replaces these values
444-
with whatever is specified in `value`. The `value` parameter
445-
should not be ``None`` in this case. You can treat this as a
446-
special case of passing two lists except that you are
447-
specifying the column to search in.
441+
should be replaced in different columns. For example,
442+
``{{'a': 1, 'b': 'z'}}`` looks for the value 1 in column 'a'
443+
and the value 'z' in column 'b' and replaces these values
444+
with whatever is specified in `value`. The `value` parameter
445+
should not be ``None`` in this case. You can treat this as a
446+
special case of passing two lists except that you are
447+
specifying the column to search in.
448448
- For a DataFrame nested dictionaries, e.g.,
449-
``{{'a': {{'b': np.nan}}}}``, are read as follows: look in column
450-
'a' for the value 'b' and replace it with NaN. The `value`
451-
parameter should be ``None`` to use a nested dict in this
452-
way. You can nest regular expressions as well. Note that
453-
column names (the top-level dictionary keys in a nested
454-
dictionary) **cannot** be regular expressions.
449+
``{{'a': {{'b': np.nan}}}}``, are read as follows: look in column
450+
'a' for the value 'b' and replace it with NaN. The `value`
451+
parameter should be ``None`` to use a nested dict in this
452+
way. You can nest regular expressions as well. Note that
453+
column names (the top-level dictionary keys in a nested
454+
dictionary) **cannot** be regular expressions.
455455
456456
* None:
457457
458458
- This means that the `regex` argument must be a string,
459-
compiled regular expression, or list, dict, ndarray or
460-
Series of such elements. If `value` is also ``None`` then
461-
this **must** be a nested dictionary or Series.
459+
compiled regular expression, or list, dict, ndarray or
460+
Series of such elements. If `value` is also ``None`` then
461+
this **must** be a nested dictionary or Series.
462462
463463
See the examples section for examples of each of these.
464464
value : scalar, dict, list, str, regex, default None
@@ -497,17 +497,17 @@
497497
TypeError
498498
* If `to_replace` is not a scalar, array-like, ``dict``, or ``None``
499499
* If `to_replace` is a ``dict`` and `value` is not a ``list``,
500-
``dict``, ``ndarray``, or ``Series``
500+
``dict``, ``ndarray``, or ``Series``
501501
* If `to_replace` is ``None`` and `regex` is not compilable
502-
into a regular expression or is a list, dict, ndarray, or
503-
Series.
502+
into a regular expression or is a list, dict, ndarray, or
503+
Series.
504504
* When replacing multiple ``bool`` or ``datetime64`` objects and
505-
the arguments to `to_replace` does not match the type of the
506-
value being replaced
505+
the arguments to `to_replace` does not match the type of the
506+
value being replaced
507507
508508
ValueError
509509
* If a ``list`` or an ``ndarray`` is passed to `to_replace` and
510-
`value` but they are not the same length.
510+
`value` but they are not the same length.
511511
512512
See Also
513513
--------
@@ -518,17 +518,17 @@
518518
Notes
519519
-----
520520
* Regex substitution is performed under the hood with ``re.sub``. The
521-
rules for substitution for ``re.sub`` are the same.
521+
rules for substitution for ``re.sub`` are the same.
522522
* Regular expressions will only substitute on strings, meaning you
523-
cannot provide, for example, a regular expression matching floating
524-
point numbers and expect the columns in your frame that have a
525-
numeric dtype to be matched. However, if those floating point
526-
numbers *are* strings, then you can do this.
523+
cannot provide, for example, a regular expression matching floating
524+
point numbers and expect the columns in your frame that have a
525+
numeric dtype to be matched. However, if those floating point
526+
numbers *are* strings, then you can do this.
527527
* This method has *a lot* of options. You are encouraged to experiment
528-
and play with this method to gain intuition about how it works.
528+
and play with this method to gain intuition about how it works.
529529
* When dict is used as the `to_replace` value, it is like
530-
key(s) in the dict are the to_replace part and
531-
value(s) in the dict are the value parameter.
530+
key(s) in the dict are the to_replace part and
531+
value(s) in the dict are the value parameter.
532532
533533
Examples
534534
--------

0 commit comments

Comments
 (0)