numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
fix(x, out=None)

Round an array of floats element-wise to nearest integer towards zero. The rounded values are returned as floats.

Parameters

x : array_like

An array of floats to be rounded

out : ndarray, optional

A location into which the result is stored. If provided, it must have a shape that the input broadcasts to. If not provided or None, a freshly-allocated array is returned.

Returns

out : ndarray of floats

A float array with the same dimensions as the input. If second argument is not supplied then a float array is returned with the rounded values.

If a second argument is supplied the result is stored there. The return value :None:None:`out` is then a reference to that array.

Round to nearest integer towards zero.

See Also

around

Round to given number of decimals

ceil
floor
rint
trunc

Examples

>>> np.fix(3.14)
3.0
>>> np.fix(3)
3.0
>>> np.fix([2.1, 2.9, -2.1, -2.9])
array([ 2.,  2., -2., -2.])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.core.floor numpy.ma.core.ceil numpy.around

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/ufunclike.py#73
type: <class 'function'>
Commit: