In this code
N = 4
M = 30
# Generar datos a partir de 3 clusters diferentes:
X1 = 10 + 2*np.random.randn(M/3,N)
X2 = -10 + 5*np.random.randn(M/3,N)
X3 = 1*np.random.randn(M/3,N)
I get this error
Traceback (most recent call last):
File "/home/user/PycharmProjects/tema3/3.18_MDS.py", line 16, in <module>
X1 = 10 + 2*int(np.random.randn(M/3,N)) # cluster 1 (dispersion media)
File "mtrand.pyx", line 1420, in mtrand.RandomState.randn
File "mtrand.pyx", line 1550, in mtrand.RandomState.standard_normal
File "mtrand.pyx", line 167, in mtrand.cont0_array
TypeError: 'float' object cannot be interpreted as an integer
I'm not sure about the problem because I think I'm not pasing any float to randn.
print(M/3)//. Try replacingM/3withM//3everywhere./operator is not obvious./that's the problem, it's numpy not accepting30/3 = 10.0as an integer (even though it is an integer)