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

Function _round_if_needed

numpy/lib/arraypad.py:18–30  ·  view source on GitHub ↗

Rounds arr inplace if destination dtype is integer. Parameters ---------- arr : ndarray Input array. dtype : dtype The dtype of the destination array.

(arr, dtype)

Source from the content-addressed store, hash-verified

16
17
18def _round_if_needed(arr, dtype):
19 """
20 Rounds arr inplace if destination dtype is integer.
21
22 Parameters
23 ----------
24 arr : ndarray
25 Input array.
26 dtype : dtype
27 The dtype of the destination array.
28 """
29 if np.issubdtype(dtype, np.integer):
30 arr.round(out=arr)
31
32
33def _slice_at_axis(sl, axis):

Callers 1

_get_statsFunction · 0.85

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected