MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / column_reshape

Function column_reshape

machine_learning/dimensionality_reduction.py:20–29  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

18
19
20def 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
32def covariance_within_classes(

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected