MCPcopy Index your code
hub / github.com/numpy/numpy / _round_if_needed

Function _round_if_needed

numpy/lib/_arraypad_impl.py:19–31  ·  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

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

Callers 1

_get_statsFunction · 0.85

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…