Reshape 1D values, raise on anything else other than 2D.
(values: np.ndarray)
| 540 | |
| 541 | |
| 542 | def _ensure_2d(values: np.ndarray) -> np.ndarray: |
| 543 | """ |
| 544 | Reshape 1D values, raise on anything else other than 2D. |
| 545 | """ |
| 546 | if values.ndim == 1: |
| 547 | values = values.reshape((values.shape[0], 1)) |
| 548 | elif values.ndim != 2: |
| 549 | raise ValueError(f"Must pass 2-d input. shape={values.shape}") |
| 550 | return values |
| 551 | |
| 552 | |
| 553 | def _homogenize( |
no test coverage detected