でカラムからワードクラウドを作成し、私はstring
値で、次のdataframe
がありますパンダ:文字列
text
0 match of the day
1 euro 2016
2 wimbledon
3 euro 2016
は、どのように私はこのコラムからword cloud
を作成することができますか?
でカラムからワードクラウドを作成し、私はstring
値で、次のdataframe
がありますパンダ:文字列
text
0 match of the day
1 euro 2016
2 wimbledon
3 euro 2016
は、どのように私はこのコラムからword cloud
を作成することができますか?
は、私はあなたが周波数のtuple of tuplesが必要だと思うので、list comprehension
とvalue_counts
使用:
tuples = tuple([tuple(x) for x in df.text.value_counts().reset_index().values])
print (tuples)
(('euro 2016', 2), ('wimbledon', 1), ('match of the day', 1))
#https://stackoverflow.com/q/38247648/2901002
cloud.generate_from_frequencies(tuples)
あなたが意味をliteralyこのようなワードクラウド:https://github.com/amueller/word_cloud? – Protostome