MCPcopy
hub / github.com/pandas-dev/pandas / le

Method le

pandas/core/series.py:6961–7027  ·  view source on GitHub ↗

Return Less than or equal to of series and other, \ element-wise (binary operator `le`). Equivalent to ``series <= other``, but with support to substitute a fill_value for missing data in either one of the inputs. Parameters ---------- other

(self, other, level=None, fill_value=None, axis: Axis = 0)

Source from the content-addressed store, hash-verified

6959 )
6960
6961 def le(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
6962 """
6963 Return Less than or equal to of series and other, \
6964 element-wise (binary operator `le`).
6965
6966 Equivalent to ``series <= other``, but with support to substitute a
6967 fill_value for missing data in either one of the inputs.
6968
6969 Parameters
6970 ----------
6971 other : object
6972 When a Series is provided, will align on indexes. For all other types,
6973 will behave the same as ``==`` but with possibly different results due
6974 to the other arguments.
6975 level : int or name
6976 Broadcast across a level, matching Index values on the
6977 passed MultiIndex level.
6978 fill_value : None or float value, default None (NaN)
6979 Fill existing missing (NaN) values, and any new element needed for
6980 successful Series alignment, with this value before computation.
6981 If data in both corresponding Series locations is missing
6982 the result of filling (at that location) will be missing.
6983 axis : {0 or 'index'}
6984 Unused. Parameter needed for compatibility with DataFrame.
6985
6986 Returns
6987 -------
6988 Series
6989 The result of the operation.
6990
6991 See Also
6992 --------
6993 Series.ge : Return elementwise Greater than or equal to of series and other.
6994 Series.lt : Return elementwise Less than of series and other.
6995 Series.gt : Return elementwise Greater than of series and other.
6996 Series.eq : Return elementwise equal to of series and other.
6997
6998 Examples
6999 --------
7000 >>> a = pd.Series([1, 1, 1, np.nan, 1], index=['a', 'b', 'c', 'd', 'e'])
7001 >>> a
7002 a 1.0
7003 b 1.0
7004 c 1.0
7005 d NaN
7006 e 1.0
7007 dtype: float64
7008 >>> b = pd.Series([0, 1, 2, np.nan, 1], index=['a', 'b', 'c', 'd', 'f'])
7009 >>> b
7010 a 0.0
7011 b 1.0
7012 c 2.0
7013 d NaN
7014 f 1.0
7015 dtype: float64
7016 >>> a.le(b, fill_value=0)
7017 a False
7018 b True

Callers

nothing calls this directly

Calls 1

_flex_methodMethod · 0.95

Tested by

no test coverage detected