bigframes.pandas.Series.between#

Series.between(left,right,inclusive='both')[source]#

Return boolean Series equivalent to left <= series <= right.

This function returns a boolean vector containingTrue wherever thecorresponding Series element is between the boundary valuesleft andright. NA values are treated asFalse.

Examples:

Boundary values are included by default:

>>>s=bpd.Series([2,0,4,8,np.nan])>>>s.between(1,4)0     True1    False2     True3    False4     <NA>dtype: boolean

With inclusive set to “neither” boundary values are excluded:

>>>s.between(1,4,inclusive="neither")0     True1    False2    False3    False4     <NA>dtype: boolean

left and right can be any scalar value:

>>>s=bpd.Series(['Alice','Bob','Carol','Eve'])>>>s.between('Anna','Daniel')0    False1     True2     True3    Falsedtype: boolean
Parameters:
  • left (scalar orlist-like) – Left boundary.

  • right (scalar orlist-like) – Right boundary.

  • inclusive ({"both","neither","left","right"}) – Include boundaries. Whether to set each bound as closed or open.

Returns:

Series representing whether each element is between left andright (inclusive).

Return type:

bigframes.pandas.Series

On this page

This Page