MCPcopy Create free account
hub / github.com/numpy/numpy / isneginf

Function isneginf

numpy/lib/ufunclike.py:143–210  ·  view source on GitHub ↗

Test element-wise for negative infinity, return result as bool array. Parameters ---------- x : array_like The input array. out : array_like, optional A location into which the result is stored. If provided, it must have a shape that the input broadcasts

(x, out=None)

Source from the content-addressed store, hash-verified

141
142@array_function_dispatch(_dispatcher, verify=False, module='numpy')
143def isneginf(x, out=None):
144 """
145 Test element-wise for negative infinity, return result as bool array.
146
147 Parameters
148 ----------
149 x : array_like
150 The input array.
151 out : array_like, optional
152 A location into which the result is stored. If provided, it must have a
153 shape that the input broadcasts to. If not provided or None, a
154 freshly-allocated boolean array is returned.
155
156 Returns
157 -------
158 out : ndarray
159 A boolean array with the same dimensions as the input.
160 If second argument is not supplied then a numpy boolean array is
161 returned with values True where the corresponding element of the
162 input is negative infinity and values False where the element of
163 the input is not negative infinity.
164
165 If a second argument is supplied the result is stored there. If the
166 type of that array is a numeric type the result is represented as
167 zeros and ones, if the type is boolean then as False and True. The
168 return value `out` is then a reference to that array.
169
170 See Also
171 --------
172 isinf, isposinf, isnan, isfinite
173
174 Notes
175 -----
176 NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
177 (IEEE 754).
178
179 Errors result if the second argument is also supplied when x is a scalar
180 input, if first and second arguments have different shapes, or if the
181 first argument has complex values.
182
183 Examples
184 --------
185 >>> np.isneginf(np.NINF)
186 True
187 >>> np.isneginf(np.inf)
188 False
189 >>> np.isneginf(np.PINF)
190 False
191 >>> np.isneginf([-np.inf, 0., np.inf])
192 array([ True, False, False])
193
194 >>> x = np.array([-np.inf, 0., np.inf])
195 >>> y = np.array([2, 2, 2])
196 >>> np.isneginf(x, y)
197 array([1, 0, 0])
198 >>> y
199 array([1, 0, 0])
200

Callers 2

nan_to_numFunction · 0.85
test_genericMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_genericMethod · 0.68