Rounds arr inplace if destination dtype is integer. Parameters ---------- arr : ndarray Input array. dtype : dtype The dtype of the destination array.
(arr, dtype)
| 17 | |
| 18 | |
| 19 | def _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 | |
| 34 | def _slice_at_axis(sl, axis): |
no test coverage detected
searching dependent graphs…