Skip to content

Commit 25abfe1

Browse files
authored
Make Series.map() documentation a bit more verbose
1 parent 0c8442c commit 25abfe1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/core/series.py

+11
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,14 @@ def map(self, arg, na_action=None):
21382138
two bar
21392139
three baz
21402140
2141+
>>> z
2142+
{1: 'A', 2: 'B', 3: 'C'}
2143+
2144+
>>> x.map(z)
2145+
one A
2146+
two B
2147+
three C
2148+
21412149
Use na_action to control whether NA values are affected by the mapping
21422150
function.
21432151
@@ -2159,6 +2167,9 @@ def map(self, arg, na_action=None):
21592167
3 NaN
21602168
dtype: object
21612169
2170+
See also
2171+
--------
2172+
Series.apply: For applying more complex functions on a Series
21622173
"""
21632174

21642175
if is_extension_type(self.dtype):

0 commit comments

Comments
 (0)