@@ -4108,14 +4108,11 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
4108
4108
4109
4109
* dict:
4110
4110
4111
- - Nested dictionaries, e.g., {'a': {'b': nan}}, are read as
4112
- follows: look in column 'a' for the value 'b' and replace it
4113
- with nan. You can nest regular expressions as well. Note that
4114
- column names (the top-level dictionary keys in a nested
4115
- dictionary) **cannot** be regular expressions.
4116
- - Keys map to column names and values map to substitution
4117
- values. You can treat this as a special case of passing two
4118
- lists except that you are specifying the column to search in.
4111
+ - Dictionaries, e.g., {'a': 'b'}, are read as
4112
+ follows: look for the value 'a' and replace it
4113
+ with 'b'.
4114
+ - Keys map to Series values and values map to substitution
4115
+ values.
4119
4116
4120
4117
* None:
4121
4118
@@ -4126,13 +4123,10 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
4126
4123
4127
4124
See the examples section for examples of each of these.
4128
4125
value : scalar, dict, list, str, regex, default None
4129
- Value to use to fill holes (e.g. 0), alternately a dict of values
4130
- specifying which value to use for each column (columns not in the
4131
- dict will not be filled). Regular expressions, strings and lists or
4126
+ Value to use to fill holes (e.g. 0). Regular expressions, strings and lists or
4132
4127
dicts of such objects are also allowed.
4133
4128
inplace : boolean, default False
4134
- If True, in place. Note: this will modify any
4135
- other views on this object (e.g. a column form a DataFrame).
4129
+ If True, in place.
4136
4130
Returns the caller if this is True.
4137
4131
limit : int, default None
4138
4132
Maximum size gap to forward or backward fill
@@ -4148,13 +4142,13 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
4148
4142
4149
4143
See Also
4150
4144
--------
4151
- NDFrame .reindex
4152
- NDFrame .asfreq
4153
- NDFrame .fillna
4145
+ Series .reindex
4146
+ Series .asfreq
4147
+ Series .fillna
4154
4148
4155
4149
Returns
4156
4150
-------
4157
- filled : NDFrame
4151
+ filled : Series
4158
4152
4159
4153
Raises
4160
4154
------
0 commit comments