I have read some threads but I can not solve the problem.
I am using this code:
data_new=dataset_circulos[['x_tipif','y_tipif']]
A=cluster.KMeans(n_clusters=2).fit(data_new[['x_tipif','y_tipif']])
predicciones=A.predict(pd.DataFrame(data_new[['x_tipif','y_tipif']]))
data_new.loc[ : , 'predicciones'] = predicciones
centroides=A.cluster_centers_
sns.pairplot(x_vars='x_tipif', y_vars='y_tipif', data=data_new, hue="predicciones")
The application shows me the message below:
C:\Users\USER-PC\Anaconda3\lib\site-packages\pandas\core\indexing.py:376: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
How can I fix it?