Question: In Python Wordcloud , I am trying to visulalise the below. How do I join the weighted vector/array, mini_centroids[0,] to the words (terms) to display

In Python Wordcloud, I am trying to visulalise the below.

How do I "join" the weighted vector/array, mini_centroids[0,] to the words ("terms") to display in wordcloud? The [0,] is there as I have 4 rows of data relating to mini_centroid. I've printed the shape so you can see they are the same (I think)!

mini_centroids = km.cluster_centers_ centroid_1 = mini_centroids[0,] print centroid_1 print centroid_1.shape

trans_terms = terms.T print trans_terms print trans_terms.shape

[ 0.00000000e+00 0.00000000e+00 2.78921298e-02 ..., 4.33680869e-19 0.00000000e+00 4.33680869e-19] (4613L,) [['charlie' 'tree' 'final' ..., 'three' 'lungo' 'grenich']] (1L, 4613L) 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!