Hello, guys.
Really new in the forum, as well as in Python.
I' m trying to work on a project and fell on this
:
Really new in the forum, as well as in Python.
I' m trying to work on a project and fell on this

Error:***[u]C:\Users\kostas\Anaconda3\lib\site-packages\ipykernel_launcher.py:8: 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
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy[/u]****
----Any help on how i should right the code below, would be highly appreciated.!! Thanx in advance---- Kostas sse={} tx_recency = tx_user[['Recency']] for k in range(1, 10): kmeans = KMeans(n_clusters=k, max_iter=1000).fit(tx_recency) tx_recency["clusters"] = kmeans.labels_ sse[k] = kmeans.inertia_ plt.figure() plt.plot(list(sse.keys()), list(sse.values())) plt.xlabel("Number of cluster") plt.show()
Larz60+ write Apr-13-2021, 02:02 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.