Skip to content

Commit 2d838cf

Browse files
authored
DOC: add example to Interval.mid docstring (#50604)
* DOC: add example to Interval.mid docstring GH15580 * fix newline * fix example
1 parent 07822fa commit 2d838cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/_libs/interval.pyx

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ cdef class IntervalMixin:
107107
def mid(self):
108108
"""
109109
Return the midpoint of the Interval.
110+
111+
Examples
112+
--------
113+
>>> iv = pd.Interval(0, 5)
114+
>>> iv.mid
115+
2.5
110116
"""
111117
try:
112118
return 0.5 * (self.left + self.right)

0 commit comments

Comments
 (0)