Given a value, wrap it in a 0-D numpy.ndarray.
(value: Any)
| 400 | |
| 401 | |
| 402 | def to_0d_array(value: Any) -> np.ndarray: |
| 403 | """Given a value, wrap it in a 0-D numpy.ndarray.""" |
| 404 | if np.isscalar(value) or (isinstance(value, np.ndarray) and value.ndim == 0): |
| 405 | return np.array(value) |
| 406 | else: |
| 407 | return to_0d_object_array(value) |
| 408 | |
| 409 | |
| 410 | def dict_equiv( |
no test coverage detected
searching dependent graphs…