Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

3.12.5. nistats.utils.positive_reciprocal

nistats.utils.positive_reciprocal(X)

Return element-wise reciprocal of array, setting X>=0 to 0

Return the reciprocal of an array, setting all entries less than or equal to 0 to 0. Therefore, it presumes that X should be positive in general.

Parameters
Xarray-like
Returns
rXarray

array of same shape as X, dtype np.float, with values set to 1/X where X > 0, 0 otherwise