-
numpy.fix(x, y=None)
[source] -
Round to nearest integer towards zero.
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
y : ndarray, optional
Output array
Returns: out : ndarray of floats
The array of rounded numbers
Examples
123456>>> 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.
])
numpy.fix()

2025-01-10 15:47:30
Please login to continue.