Skip to content

Commit 05a2f1c

Browse files
DOC: add SA01 for pandas.Series.ge (#59067)
1 parent 0d6a48c commit 05a2f1c

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
154154
-i "pandas.Series.dt.tz_convert PR01,PR02" \
155155
-i "pandas.Series.dt.tz_localize PR01,PR02" \
156156
-i "pandas.Series.dt.unit GL08" \
157-
-i "pandas.Series.ge SA01" \
158157
-i "pandas.Series.gt SA01" \
159158
-i "pandas.Series.list.__getitem__ SA01" \
160159
-i "pandas.Series.list.flatten SA01" \

pandas/core/series.py

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6050,8 +6050,69 @@ def lt(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
60506050
other, operator.lt, level=level, fill_value=fill_value, axis=axis
60516051
)
60526052

6053-
@Appender(ops.make_flex_doc("ge", "series"))
60546053
def ge(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
6054+
"""
6055+
Return Greater than or equal to of series and other, \
6056+
element-wise (binary operator `ge`).
6057+
6058+
Equivalent to ``series >= other``, but with support to substitute a
6059+
fill_value for missing data in either one of the inputs.
6060+
6061+
Parameters
6062+
----------
6063+
other : Series or scalar value
6064+
The second operand in this operation.
6065+
level : int or name
6066+
Broadcast across a level, matching Index values on the
6067+
passed MultiIndex level.
6068+
fill_value : None or float value, default None (NaN)
6069+
Fill existing missing (NaN) values, and any new element needed for
6070+
successful Series alignment, with this value before computation.
6071+
If data in both corresponding Series locations is missing
6072+
the result of filling (at that location) will be missing.
6073+
axis : {0 or 'index'}
6074+
Unused. Parameter needed for compatibility with DataFrame.
6075+
6076+
Returns
6077+
-------
6078+
Series
6079+
The result of the operation.
6080+
6081+
See Also
6082+
--------
6083+
Series.gt : Greater than comparison, element-wise.
6084+
Series.le : Less than or equal to comparison, element-wise.
6085+
Series.lt : Less than comparison, element-wise.
6086+
Series.eq : Equal to comparison, element-wise.
6087+
Series.ne : Not equal to comparison, element-wise.
6088+
6089+
Examples
6090+
--------
6091+
>>> a = pd.Series([1, 1, 1, np.nan, 1], index=["a", "b", "c", "d", "e"])
6092+
>>> a
6093+
a 1.0
6094+
b 1.0
6095+
c 1.0
6096+
d NaN
6097+
e 1.0
6098+
dtype: float64
6099+
>>> b = pd.Series([0, 1, 2, np.nan, 1], index=["a", "b", "c", "d", "f"])
6100+
>>> b
6101+
a 0.0
6102+
b 1.0
6103+
c 2.0
6104+
d NaN
6105+
f 1.0
6106+
dtype: float64
6107+
>>> a.ge(b, fill_value=0)
6108+
a True
6109+
b True
6110+
c False
6111+
d False
6112+
e True
6113+
f False
6114+
dtype: bool
6115+
"""
60556116
return self._flex_method(
60566117
other, operator.ge, level=level, fill_value=fill_value, axis=axis
60576118
)

0 commit comments

Comments
 (0)