Skip to content

Commit ca6f30d

Browse files
DOC: keep only Series related example
1 parent c6da39c commit ca6f30d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

pandas/core/series.py

-27
Original file line numberDiff line numberDiff line change
@@ -6396,33 +6396,6 @@ def median(
63966396
>>> s = pd.Series([1, 2, 3])
63976397
>>> s.median()
63986398
2.0
6399-
6400-
With a DataFrame
6401-
6402-
>>> df = pd.DataFrame({"a": [1, 2], "b": [2, 3]}, index=["tiger", "zebra"])
6403-
>>> df
6404-
a b
6405-
tiger 1 2
6406-
zebra 2 3
6407-
>>> df.median()
6408-
a 1.5
6409-
b 2.5
6410-
dtype: float64
6411-
6412-
Using axis=1
6413-
6414-
>>> df.median(axis=1)
6415-
tiger 1.5
6416-
zebra 2.5
6417-
dtype: float64
6418-
6419-
In this case, `numeric_only` should be set to `True`
6420-
to avoid getting an error.
6421-
6422-
>>> df = pd.DataFrame({"a": [1, 2], "b": ["T", "Z"]}, index=["tiger", "zebra"])
6423-
>>> df.median(numeric_only=True)
6424-
a 1.5
6425-
dtype: float64
64266399
"""
64276400
return NDFrame.median(
64286401
self, axis=axis, skipna=skipna, numeric_only=numeric_only, **kwargs

0 commit comments

Comments
 (0)