Function to reshape a row Numpy array into a column Numpy array >>> input_array = np.array([1, 2, 3]) >>> column_reshape(input_array) array([[1], [2], [3]])
(input_array: np.ndarray)
| 18 | |
| 19 | |
| 20 | def column_reshape(input_array: np.ndarray) -> np.ndarray: |
| 21 | """Function to reshape a row Numpy array into a column Numpy array |
| 22 | >>> input_array = np.array([1, 2, 3]) |
| 23 | >>> column_reshape(input_array) |
| 24 | array([[1], |
| 25 | [2], |
| 26 | [3]]) |
| 27 | """ |
| 28 | |
| 29 | return input_array.reshape((input_array.size, 1)) |
| 30 | |
| 31 | |
| 32 | def covariance_within_classes( |
no outgoing calls
no test coverage detected