diff --git a/ci/code_checks.sh b/ci/code_checks.sh index e987e147fa343..3e9138814fbdf 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -310,7 +310,11 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then pytest -q --doctest-modules pandas/core/indexes/ RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests reshaping functions' ; echo $MSG + MSG='Doctests ops' ; echo $MSG + pytest -q --doctest-modules pandas/core/ops/ + RET=$(($RET + $?)) ; echo $MSG "DONE" + + MSG='Doctests reshape' ; echo $MSG pytest -q --doctest-modules pandas/core/reshape/ RET=$(($RET + $?)) ; echo $MSG "DONE" diff --git a/pandas/core/ops/missing.py b/pandas/core/ops/missing.py index 854d6072eea36..c33cb32dcec19 100644 --- a/pandas/core/ops/missing.py +++ b/pandas/core/ops/missing.py @@ -72,7 +72,7 @@ def fill_zeros(result, x, y): def mask_zero_div_zero(x, y, result): """ - Set results of 0 / 0 or 0 // 0 to np.nan, regardless of the dtypes + Set results of 0 // 0 to np.nan, regardless of the dtypes of the numerator or the denominator. Parameters @@ -83,13 +83,16 @@ def mask_zero_div_zero(x, y, result): Returns ------- - filled_result : ndarray + ndarray + The filled result. Examples -------- >>> x = np.array([1, 0, -1], dtype=np.int64) + >>> x + array([ 1, 0, -1]) >>> y = 0 # int 0; numpy behavior is different with float - >>> result = x / y + >>> result = x // y >>> result # raw numpy result does not fill division by zero array([0, 0, 0]) >>> mask_zero_div_zero(x, y, result)