Suppose I have 1x1x1x1x... array and wish to convert it to scalar?
How do I do it?
squeeze does not help.
squeeze
import numpy as np ma
You can use the item() function:
item()
import numpy as np matrix = np.array([[[[7]]]]) print(matrix.item())
Output
7