The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Anybody can ask a question
Anybody can answer
The best answers are voted up and moderated by our team

Customer Analytics in Python

Customer Analytics in Python


df_segm_kmeans[“Segment k-means”] = kmeans.labels_

while entering above line…it was creating series in……df_segm_analysis……
what is the reason?
the video from………k means clustering (k-means clustering results).
in your video explanation, you didn’t get that series in the data frame output..

1 Answer

365 Team

Hi Ramanjaneyulu, 
the df_segm_kmeans data frame is our regular data df_segmentation + the assigned cluster from each algorithm. So, in this data frame we have a line for each customer, 2000 in total, with a column for their Age, Occupation, etc. and the cluster they’ve been assigned to. So the dimension of this table are 2000 rows by 8 columns
df_segm_analysis, on the other hand, is a summary table for the four clusters and has 4 lines in total. Here, for each cluster we have information on the distribution of each feature: Age, Occupation, Income and so on. When we create it the table has the size 4 rows by 7 columns (though we add 2 additional columns later on).
Hope this clears up the confusion!

Complete Data Science Training
Save 60%