10. Create a summary table (sample below) and fill the value with the median value for each group. Hint: Use groupby fun
Posted: Sun May 15, 2022 12:17 pm
Using Python please.
10. Create a summary table (sample below) and fill the value with the median value for each group. Hint: Use groupby function. Age Income Spending cluster 0 Gender Female Male 1 summary_table - x_pca_df.groupby("cluster").agg(("x1": "median", "x2": "median")) 2 summary_table[ "x1"].fillna(summary_table[ "x1"].median(), inplace = True) 3 summary_table[ "x2"].fillna( summary_table["x2"].median(), inplace = True) 4 print (summary_table) C x1 x2 cluster 0 1 15.956864 -1.926817 -18.570305 4.095686 11. Summarize and discuss the table output and suggest some insight regarding customer segmentation. Discuss your insights with respect clusters and their spending scores and how you might direct marketing campaigns to high potential customers. [ 1 # solution U 1
10. Create a summary table (sample below) and fill the value with the median value for each group. Hint: Use groupby function. Age Income Spending cluster 0 Gender Female Male 1 summary_table - x_pca_df.groupby("cluster").agg(("x1": "median", "x2": "median")) 2 summary_table[ "x1"].fillna(summary_table[ "x1"].median(), inplace = True) 3 summary_table[ "x2"].fillna( summary_table["x2"].median(), inplace = True) 4 print (summary_table) C x1 x2 cluster 0 1 15.956864 -1.926817 -18.570305 4.095686 11. Summarize and discuss the table output and suggest some insight regarding customer segmentation. Discuss your insights with respect clusters and their spending scores and how you might direct marketing campaigns to high potential customers. [ 1 # solution U 1