array = df.as_matrix()
array = np.int(array)
I tried:
array = np.int(array)
for :
array[i][10]/5
but got :
array = np.int(array) TypeError: only length-1 arrays can be converted to Python scalars????
Try:
>>> a = np.random.normal(20, 5, size=(2,2))
array([[ 24.04255462, 24.24954137],
[ 14.64894245, 16.17946985]])
>>> a = a.astype(int)
>>> a
array([[24, 24],
[14, 16]])
Check the docs.
array.astype(int).np.intis the same as the base Pythonint, a function that creates a (one) integer from a number or string. It does not convert an array (or list or string of multiple numbers).